Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Zdenek Dohnal
252d750e4e Leftover of merging 2019-11-01 09:49:16 +01:00
Zdenek Dohnal
292bd27bbe Merge branch 'private-print-ppd-is-None' of ssh://pkgs.fedoraproject.org/rpms/hplip into private-print-ppd-is-None 2019-11-01 09:47:19 +01:00
Zdenek Dohnal
757cacaa63 print_ppd is None 2019-11-01 09:45:24 +01:00
Zdenek Dohnal
4e21cbba7d print_ppd is None 2019-05-22 10:26:36 +02:00
2 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,14 @@
diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py
index ac45357..691492a 100644
--- a/ui5/setupdialog.py
+++ b/ui5/setupdialog.py
@@ -1046,6 +1046,9 @@ class SetupDialog(QDialog, Ui_Dialog):
def setupPrinter(self):
status = cups.IPP_BAD_REQUEST
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
+ if self.print_ppd is None:
+ log.error("No appropriate print PPD file found for model %s" % self.model)
+ return status
try:
if not os.path.exists(self.print_ppd[0]): # assume foomatic: or some such
add_prnt_args = (from_unicode_to_str(self.printer_name), self.device_uri, self.print_location, '', self.print_ppd[0], self.print_desc)

View file

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.19.8
Release: 2%{?dist}
Release: 4%{?dist}
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
Url: https://developers.hp.com/hp-linux-imaging-and-printing
@ -128,6 +128,15 @@ Patch52: hplip-missing-drivers.patch
# so now it uses PIL.Image.PILLOW_VERSION
# reported upstream https://bugs.launchpad.net/hplip/+bug/1846218
Patch53: hplip-pillow-version.patch
# print_ppd attribute can be None during graphical hp-setup, it can be due duplicate queue
# and user did not choose 'Yes' during dialog, or he has scanjet or digital_sender models,
# or any PPD was not found. I'm unable to say what exactly causes it, because I do not have
# any reproducer. The patch only catches the print_ppd when it is None, print log message
# and returns failure (it would be good to have some recovery from the state, but I would
# not go any further without reproducer).
# bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1712540
# I did not report to upstream since I'm not sure if it helps
Patch54: hplip-print-ppd-is-None.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: python3-pillow
@ -385,6 +394,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h
# 1742949, 1740132, 1739855 - missing drivers
%patch52 -p1 -b .missing-drivers
%patch53 -p1 -b .pillow-version
# 1712540 - [abrt] hplip: setupPrinter(): setupdialog.py:1050:setupPrinter:TypeError: 'NoneType' object is not subscriptable
%patch54 -p1 -b .print-ppd-is-None
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
@ -691,6 +702,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
%changelog
* Fri Nov 01 2019 Zdenek Dohnal <zdohnal@redhat.com> - 3.19.8-3
- 1712540 - [abrt] hplip: setupPrinter(): setupdialog.py:1050:setupPrinter:TypeError: 'NoneType' object is not subscriptable
* Tue Oct 01 2019 Zdenek Dohnal <zdohnal@redhat.com> - 3.19.8-2
- hp-check traceback due change in python-pillow