Hplip does not work with Python3: Unicode error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
New
|
Undecided
|
Unassigned | ||
hplip (Arch Linux) |
New
|
Undecided
|
Unassigned | ||
hplip (Debian) |
Fix Released
|
Unknown
|
|||
hplip (Fedora) |
Confirmed
|
Undecided
|
|||
hplip (Gentoo Linux) |
Fix Released
|
Medium
|
Bug Description
The hp-setup program crashes with a UnicodeDecodeError when it tries to detect my Photosmart 2575 printer. I am running Arch Linux which has switched to using Python3 by default (/usr/bin/python is a symlink to python3).
Below is a part of a debugging session demonstrating the problem. The variable x contains (part of) the response from my printer to the multicast query sent on the network. The to_string_utf8 function is supposed to convert the contents of the byte array to UTF-8, but chokes on the 0xf0 in position 364, presumably because the bytes aren't all strictly ASCII codepoints.
Running the program using Python2 does not trigger this bug.
My printer is a HP Photosmart 2575, Python version 3.4.3, Python2 version 2.7.10, Hplip version hplip 3.15.6-1 (Arch Linux).
(Pdb) n
> /usr/share/
-> struct.
(Pdb) n
> /usr/share/
-> x = struct.
(Pdb) n
> /usr/share/
-> x= to_string_utf8(x)
(Pdb) p x
b'(x-hp-
(Pdb) n
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 364: invalid continuation byte
> /usr/share/
-> x= to_string_utf8(x)
(Pdb)
Changed in hplip (Debian): | |
importance: | Undecided → Unknown |
status: | New → Unknown |
Changed in hplip (Debian): | |
status: | Unknown → Confirmed |
Changed in hplip (Debian): | |
status: | Confirmed → Fix Committed |
Changed in hplip (Debian): | |
status: | Fix Committed → Fix Released |
Changed in hplip (Gentoo Linux): | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in hplip (Gentoo Linux): | |
status: | New → Fix Released |
Changed in hplip: | |
status: | Fix Committed → New |
Changed in hplip (Fedora): | |
importance: | Unknown → Undecided |
status: | Unknown → Confirmed |
Please apply this patch and see if it works hplip/base/ sixext. py
1. Take a back up of /usr/share/
1. Download this patch in any folder and navigate to that folder
2. Apply this patch as a root user using the following command
'patch /usr/share/ hplip/base/ sixext. py < sixext.patch'