Comment 3 for bug 1826988

Revision history for this message
Leonidas (jpegxguy) wrote :

This has been an issue for a while now. A lot of the hplip functionality depends on that line of code. The translate function you're using doesn't work in python 3.

$ hp-faxsetup

HP Linux Imaging and Printing System (ver. 3.19.8)
Fax Device Setup Utility ver. 0.1

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.

qt5ct: using qt5ct plugin
Traceback (most recent call last):
  File "/usr/share/hplip/ui5/faxsetupdialog.py", line 139, in FaxComboBox_currentChanged
    self.updateHeaderTab()
  File "/usr/share/hplip/ui5/faxsetupdialog.py", line 254, in updateHeaderTab
    name_company = to_unicode(self.dev.getStationName())
  File "/usr/share/hplip/fax/pmlfax.py", line 158, in getStationName
    data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
  File "/usr/share/hplip/base/utils.py", line 958, in printable
    return s.translate(identity, unprintable)
TypeError: translate() takes exactly one argument (2 given)
Ακυρώθηκε (core dumped)

Let's try with python2. It will fail to launch because the module named in the error is only shipped for python3 from hplip.

$ python2 /usr/bin/hp-faxsetup
Traceback (most recent call last):
  File "/usr/bin/hp-faxsetup", line 38, in <module>
    from base import device, utils, maint, tui, module
  File "/usr/share/hplip/base/device.py", line 42, in <module>
    from . import status
  File "/usr/share/hplip/base/status.py", line 33, in <module>
    import cupsext
ImportError: No module named cupsext

It seems like an easy fix to use some combination of the py3 maketrans + translate functions or something.

Please fix this. It's a major issue as it stops a lot of the functionality, no GUI for printer install, no Fax setup etc.