From 4e21cbba7d3d0253e70d30b613d7167c23d0f0d6 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 22 May 2019 10:26:36 +0200 Subject: [PATCH 1/3] print_ppd is None --- hplip-print-ppd-is-None.patch | 14 ++++++++++++++ hplip.spec | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 hplip-print-ppd-is-None.patch 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 796812f..7b69042 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.12 -Release: 11%{?dist} +Release: 12%{?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 @@ -111,6 +111,15 @@ Patch46: hplip-m278-m281-needs-plugin.patch # bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1695716 # reported upstream Patch47: hplip-hpcups-crash.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 +Patch48: hplip-print-ppd-is-None.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -364,6 +373,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch46 -p1 -b .m278-m281-needs-plugin # 1695716 - hpcups crashes in Compressor destructor %patch47 -p1 -b .hpcups-crash +# 1712540 - [abrt] hplip: setupPrinter(): setupdialog.py:1050:setupPrinter:TypeError: 'NoneType' object is not subscriptable +%patch48 -p1 -b .print-ppd-is-None sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -664,6 +675,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Wed May 22 2019 Zdenek Dohnal - 3.18.12-12 +- 1712540 - [abrt] hplip: setupPrinter(): setupdialog.py:1050:setupPrinter:TypeError: 'NoneType' object is not subscriptable + * Thu May 16 2019 Zdenek Dohnal - 3.18.12-11 - 1706233 - hplip FTBFS with python38 From 757cacaa6348cb5a7a31d9b7460d197bdb84166f Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 22 May 2019 10:26:36 +0200 Subject: [PATCH 2/3] print_ppd is None --- hplip-print-ppd-is-None.patch | 14 ++++++++++++++ hplip.spec | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 hplip-print-ppd-is-None.patch 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..ddd879d 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: 3%{?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 From 252d750e4e4457b1399047b2bb51cb6e6a7e8b8e Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 1 Nov 2019 09:49:16 +0100 Subject: [PATCH 3/3] Leftover of merging --- hplip.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/hplip.spec b/hplip.spec index db7cde2..3c13004 100644 --- a/hplip.spec +++ b/hplip.spec @@ -105,7 +105,6 @@ Patch46: hplip-m278-m281-needs-plugin.patch # bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1695716 # reported upstream Patch47: hplip-hpcups-crash.patch -<<<<<<< HEAD # Fixing the issues found by coverity scan # reported upstream https://bugs.launchpad.net/hplip/+bug/1808145 Patch48: hplip-covscan.patch @@ -384,7 +383,6 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch46 -p1 -b .m278-m281-needs-plugin # 1695716 - hpcups crashes in Compressor destructor %patch47 -p1 -b .hpcups-crash -<<<<<<< HEAD # fixing issues found by coverity scan %patch48 -p1 -b .covscan # segfault during logging (1727162)