diff --git a/hplip-print-ppd-is-None.patch b/hplip-print-ppd-is-None.patch new file mode 100644 index 0000000..58f42f7 --- /dev/null +++ b/hplip-print-ppd-is-None.patch @@ -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) diff --git a/hplip.spec b/hplip.spec index 52f2e17..3c13004 100644 --- a/hplip.spec +++ b/hplip.spec @@ -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 - 3.19.8-3 +- 1712540 - [abrt] hplip: setupPrinter(): setupdialog.py:1050:setupPrinter:TypeError: 'NoneType' object is not subscriptable + * Tue Oct 01 2019 Zdenek Dohnal - 3.19.8-2 - hp-check traceback due change in python-pillow