slackware-current: hp-setup from hplip-3.23.12-x86_64-4 throws UnicodeDecodeError after selecting printer
When I try to add a printer using hp-setup to add a network printer I've successfully added in the past I get the error below.
Steps:
I see that there were patches applied to -4 to fix unicode errors, but they don't seem to work for whatever this is. I assume this is a system misconfiguration problem on my end, but I don't know where to start checking things. Things I've tried:
The trace: Code:
HP Linux Imaging and Printing System (ver. 3.23.12) |
For posterity, I get the same error running
Code:
$ hp-setup -ldebug -i Code:
$ diff -u models.py.orig models.py |
I have also encountered the same problem and look forward to solving it.
|
I look forward to Pat could see this issue and providing a solution.
|
Quote:
|
Quote:
|
1 Attachment(s)
Quote:
|
Show the output of command 'locale'.
|
1 Attachment(s)
Quote:
|
Quote:
|
hp-setup
HP Linux Imaging and Printing System (ver. 3.23.12) 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. Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=mdns) Traceback (most recent call last): File "/usr/share/hplip/ui5/setupdialog.py", line 1395, in NextButton_clicked self.showAddPrinterPage() File "/usr/share/hplip/ui5/setupdialog.py", line 709, in showAddPrinterPage self.findPrinterPPD() File "/usr/share/hplip/ui5/setupdialog.py", line 790, in findPrinterPPD ppdName = cups.getPpdName(self.model) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/hplip/prnt/cups.py", line 196, in getPpdName dict=m.read_all_files(False) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/hplip/base/models.py", line 456, in read_all_files self.read_section(self.released_dat) File "/usr/share/hplip/base/models.py", line 487, in read_section line = fd.readline() ^^^^^^^^^^^^^ File "/usr/lib64/python3.11/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 913: ordinal not in range(128) fish: Job 1, 'hp-setup' terminated by signal SIGABRT (Abort) |
Similar locale here.
Code:
$ locale in bash at 09:01:41 Alternatively, exporting PYTHONUTF8=1 also lets it work. Relevant PEPs: So what do most people set LC_* to? |
Quote:
Code:
$ locale |
Looks like there is a single non-ascii character in /usr/share/hplip/data/models/models.dat (looks like a unicode space https://unicodeplus.com/U+2002)
Code:
diff -u /usr/share/hplip/data/models/models.dat.orig /usr/share/hplip/data/models/models.dat in bash at 10:26:11 I'd think any impact would be limited to people with a HP Color LaserJet Enterprise MFP X58045dn, but who knows. |
Looking at the output of locale in post#9, there are a couple of oddities:
LC_TIME=en_GB.UTF-8 when I would expect LC_TIME="en_US.UTF-8" and LC_TELEPHONE=zh_CN.UTF-8 when I would expect LC_TELEPHONE="en_US.UTF-8". The screenshot shows the fish shell running in a konsole window. Is the output from locale run in konsole the same? Apparently the fish shell expects to be passed those variables. |
All times are GMT -5. The time now is 09:02 AM. |