Hi, the hp-setup tool from hplip is unusable in manjaro since it fails producing a backtrace.
Specifically, it fails in line 958 of file /usr/share/hplip/base/utils.py where the function str.translate is
incorrectly invoked with two arguments when it take a single one.
This may in fact not be an upstream bug, but the consequence of the fact that the upstream code is meant to be run on a python version different than the one provided by manjaro, in which case I guess the python code should better be patched downstream. I am almost sure that for some time I saw something similar on ubuntu as well.
I realize that there are other ways to install printers, including doing it directly from CUPS or the KDE system settings. However the hp-setup tool is handy for simultaneously installing printers and faxes on multifunction hardware.
I wonder if this issue is inherited from arch.
Is there a bug tracker for problems like this?
I remember that I didn’t actually need to use this god-awful setup program and installing the drivers was enough to be able to use my scanner-printer combo.
The beauty of Python is that you could “simply” modify yourself but you’ll end in a devilish circle where everytime you fix something, it’ll explode somewhere else.
You could use pyenv to install a supported version but the str.translate function only takes two parameters in Python 2, so I’d rather not go down that hole.
…is there a typo in your file ?
My hplip version is 3.21.10-1 and no python2 on my system. Printing/scanning is fine here on 3 different devices.
But again, I don’t have ARM64 and I don’t waste my time with KDE.
The s.translate function can only work with Python 2. Since 3, it only takes 1 parameter which results in the OP’s error message.
I don’t know the coverage but I guess that only the setup utility and not the driver itself uses this function so that printing and scanning still works. (I also do have an HP where it does work.)
The fact that hplip is a python2 app is certainly an upstream issue, because python2 is deprecated. But it is also a downstream issue if downstream gets the dependencies wrong or pretends to use it as a python3 application without patching it to this aim. As is hplip declares python (i.e., python 3) as its requirement.
IMHO one should either:
sustitute python2 for python in the hashbangs and make hplip depend on python2;
do some minimal downstream patching of hplip to make it run with python3.
I am not sufficiently experienced with Manjaro to know if the arch bug tracker takes issue reports from Manjaro users when packages taken as-they-are from arch are concerned, does it?