[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#948932: /usr/share/hplip/base/utils.py: /usr/share/hplip/base/utils.py has python error



Package: hplip-data
Version: 3.19.12+dfsg0-2
Severity: important
File: /usr/share/hplip/base/utils.py
Tags: patch

When trying to add a new printer, I receive the error below, and
the printer is not added. Applying the patch allow the printer to be
added.

user@debian-10-testing:~$ hp-setup -ldebug

HP Linux Imaging and Printing System (ver. 3.19.11)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

hp-setup[940]: debug: param=
hp-setup[940]: debug: selected_device_name=None
hp-setup[940]: debug: Using PyQt5
hp-setup[940]: debug: Sys.argv=['/usr/bin/hp-setup', '-ldebug'] printer_name=None param= jd_port=1 device_uri=None remove=False
hp-setup[940]: debug: Starting GUI Event Loop...
hp-setup[940]: debug: Cache miss: officejet_pro_8500_a909g
hp-setup[940]: debug: Reading file: /usr/share/hplip/data/models/models.dat
hp-setup[940]: debug: Searching for section [officejet_pro_8500_a909g] in file /usr/share/hplip/data/models/models.dat
hp-setup[940]: debug: Found section [officejet_pro_8500_a909g] in file /usr/share/hplip/data/models/models.dat
Found device: hp:/net/Officejet_Pro_8500_A909g?hostname=hp8500
hp-setup[940]: debug: Unable to open file /var/lib/hp/hplip.state for reading.
hp-setup[940]: debug: {}
hp-setup[940]: debug: Officejet_Pro_8500_A909g
hp-setup[940]: debug: (CUPS 1.2.x) Getting list of PPDs using CUPS_GET_PPDS...
hp-setup[940]: debug: CUPS PPD base path = /usr/share/cups/model
hp-setup[940]: debug: Foomatic PPD base path = /usr/share/ppd/hplip
hp-setup[940]: debug: Matching PPD list to model  officejet_pro_8500_a909g...
hp-setup[940]: debug: Found match: hplip:0/ppd/hplip/HP/hp-officejet_pro_8500_a909g.ppd
hp-setup[940]: debug: Found match: hplip-data:0/ppd/hplip/HP/hp-officejet_pro_8500_a909g.ppd
hp-setup[940]: debug: Found match: drv:///hpcups.drv/hp-officejet_pro_8500_a909g.ppd
hp-setup[940]: debug: [('hplip:0/ppd/hplip/HP/hp-officejet_pro_8500_a909g.ppd', []), ('hplip-data:0/ppd/hplip/HP/hp-officejet_pro_8500_a909g.ppd', []), ('drv:///hpcups.drv/hp-officejet_pro_8500_a909g.ppd', [])]
hp-setup[940]: debug: 3 matches found. Searching based on PDL: Host > PS,PDF > PCL/Other
hp-setup[940]: debug: 3 matches found. Searching based on Filters: HPCUPS > HPIJS
hp-setup[940]: debug: Selecting PPD: drv:///hpcups.drv/hp-officejet_pro_8500_a909g.ppd
hp-setup[940]: debug: {}
hp-setup[940]: debug: Searching for fax PPD for model officejet_pro_8500_a909g  hpcups_build =1
hp-setup[940]: debug: ppds=['/usr/share/ppd/hplip/HP/HP-Fax4-hpcups.ppd.gz', '/usr/share/ppd/hplip/HP/HP-Fax2-hpcups.ppd.gz', '/usr/share/ppd/hplip/HP/HP-Fax-hpcups.ppd.gz', '/usr/share/ppd/hplip/HP/HP-Fax3-hpcups.ppd.gz']
hp-setup[940]: debug: Found fax PPD: /usr/share/ppd/hplip/HP/HP-Fax-hpcups.ppd.gz
hp-setup[940]: debug: fax-type=1
Traceback (most recent call last):
  File "/usr/share/hplip/ui5/setupdialog.py", line 1304, in NextButton_clicked
    self.showAddPrinterPage()
  File "/usr/share/hplip/ui5/setupdialog.py", line 728, in showAddPrinterPage
    self.readwriteFaxInformation()
  File "/usr/share/hplip/ui5/setupdialog.py", line 1127, in readwriteFaxInformation
    self.fax_number = to_unicode(d.getPhoneNum())
  File "/usr/share/hplip/fax/pmlfax.py", line 146, in getPhoneNum
    data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
  File "/usr/share/hplip/base/utils.py", line 960, in printable
    return s.translate(identity, unprintable)
TypeError: translate() takes exactly one argument (2 given)
Aborted


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.84-1.pvops.qubes.x86_64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages hplip-data depends on:
ii  python3   3.7.5-3
ii  xz-utils  5.2.4-1+b1

hplip-data recommends no packages.

Versions of packages hplip-data suggests:
ii  hplip  3.19.12+dfsg0-2

-- no debconf information
--- /usr/share/hplip/base/utils.py~	2018-12-10 11:12:18.000000000 -0800
+++ /usr/share/hplip/base/utils.py	2020-01-13 16:51:32.014000000 -0800
@@ -956,7 +956,7 @@
 
 def printable(s):
     if s:
-        return s.translate(identity, unprintable)
+        return s.translate(identity + unprintable)
     else:
         return ""
 
--- /usr/share/hplip/base/utils.py~	2018-12-10 11:12:18.000000000 -0800
+++ /usr/share/hplip/base/utils.py	2020-01-13 16:51:32.014000000 -0800
@@ -956,7 +956,7 @@
 
 def printable(s):
     if s:
-        return s.translate(identity, unprintable)
+        return s.translate(identity + unprintable)
     else:
         return ""
 

Reply to: