#2 1566938 - Fix TypeError when printing ImportError message in hpfax
Merged 9 months ago by tkorbar. Opened 9 months ago by tkorbar.

@@ -0,0 +1,19 @@

+ commit cdf5cb36e5d5a86f6a690c5861666cdc2da70593

+ Author: Tomas Korbar <tkorbar@redhat.com>

+ Date:   Wed Sep 19 15:33:03 2018 +0200

+ 

+     Fix TypeError in hpfax

+ 

+ diff --git a/fax/backend/hpfax.py b/fax/backend/hpfax.py

+ index 9560e84..bc0912a 100755

+ --- a/fax/backend/hpfax.py

+ +++ b/fax/backend/hpfax.py

+ @@ -89,7 +89,7 @@ try:

+      from base import utils

+      from prnt import cups

+  except ImportError as e:

+ -    bug("Error importing HPLIP modules: %s\n" % (pid, e))

+ +    bug("Error importing HPLIP modules: %s\n" % (e))

+      sys.exit(1)

+  

+  def handle_sigpipe():

file modified
+8 -1

@@ -7,7 +7,7 @@

  Summary: HP Linux Imaging and Printing Project

  Name: hplip

  Version: 3.18.6

- Release: 6%{?dist}

+ Release: 7%{?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

@@ -50,6 +50,7 @@

  # m278-m281 doesn't work correctly again

  Patch32: hplip-colorlaserjet-mfp-m278-m281.patch

  Patch33: hplip-error-print.patch

+ Patch34: hplip-hpfax-importerror-print.patch

  

  Requires: %{name}-libs%{?_isa} = %{version}-%{release}

  Requires: python3-pillow

@@ -256,6 +257,9 @@

  # TypeError: 'Error' object does not support indexing (bug #1564770)

  %patch33 -p1 -b .error-print-fix

  

+ # TypeError: not all arguments converted during string formatting (bug #1566938)

+ %patch34 -p1 -b .hpfax-import-error-print

+ 

  sed -i.duplex-constraints \

      -e 's,\(UIConstraints.* \*Duplex\),//\1,' \

      prnt/drv/hpcups.drv.in

@@ -541,6 +545,9 @@

  %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio

  

  %changelog

+ * Tue Sep 25 2018 Tomas Korbar <tkorbar@redhat.com> - 3.18.6-7

+ - 1566938 - Fix TypeError when printing ImportError message in hpfax

+ 

  * Tue Sep 18 2018 Tomas Korbar <tkorbar@redhat.com> - 3.18.6-6

  - 1564770 - Fix TypeError when printing error object message

  

This bug is caused by more arguments than argument specifiers in formatted string. Imho adding pid to the formatted string is obsolete because bug function in hpfax adds pid to the message itself. After removal of pid, call to bug function works as expected.

rebased onto 0fe9b32

9 months ago

Pull-Request has been merged by tkorbar

9 months ago