Package: hplip
Version: 3.22.10+dfsg0-8.1
Severity: normal
Dear Maintainer,
I don't think the patch 0086-add-compatibility-with-pythin3.13.patch
(sic: pythin) is correct.
It replaces readfp with read_file in one python file, in similar manner
as the next patch in series
(0087-Use-read_file-instead-of-readfp-for-python-3.12.patch) that makes
the same fix to several other python files. But it does not fix the
actual issue with regexp string format reported in the bug report
#1094348. I suppose some mistake was made when preparing the patches.
I believe the correct fix is to add a raw string prefix 'r'.
hp-check:
lsusb_pat =
re.compile(r"""^Bus\s([0-9a-fA-F]{3,3})\sDevice\s([0-9a-fA-F]{3,3}):\sID\s([0-9a-fA-F]{4,4}):([0-9a-fA-F]{4,4})(.*)""",
re.IGNORECASE)
base/device.py has the same issue causing similar errors when running
e.g. hp-config_usb_printer:
hp-firmware -y3 -s 001:039
hp-config_usb_printer[216738]: debug: /usr/share/hplip/base/device.py:49:
SyntaxWarning: invalid escape sequence '\d'
http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I)
hp-config_usb_printer[216738]: debug: /usr/share/hplip/base/device.py:49:
SyntaxWarning: invalid escape sequence '\d'
http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I)
hp-config_usb_printer[216738]: debug: /usr/share/hplip/base/device.py:49:
SyntaxWarning: invalid escape sequence '\d'
http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I)
hp-config_usb_printer[216738]: debug: /usr/share/hplip/base/device.py:49:
SyntaxWarning: invalid escape sequence '\d'
http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I)
(I would not be surprised if there are other instances of re.compile
with this same problem.)
I've noticed also one more Python 3.13 compatibility problem, in
base/utils.py:
hp-config_usb_printer[214163]: debug: Traceback (most recent call last):
File "/usr/bin/hp-firmware", line 189, in <module>
if d.downloadFirmware(usb_bus_id, usb_device_id):
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/hplip/base/device.py", line 2642, in downloadFirmware
log.debug("%s bytes downloaded." % utils.commafy(bytes_written))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/share/hplip/base/utils.py", line 476, in commafy
return locale.format("%s", val, grouping=True)
^^^^^^^^^^^^^
AttributeError: module 'locale' has no attribute 'format'
This error occurs because the format function has been removed from the
locale module in Python 3.12. To fix it, you should replace calls to
locale.format with the appropriate alternative, such as using
locale.format_string instead.
Thanks.
-- System Information:
Debian Release: 13.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.63+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages hplip depends on:
ii adduser 3.152
ii cups 2.4.10-3+deb13u2
ii hplip-data 3.22.10+dfsg0-8.1
ii libc6 2.41-12+deb13u1
ii libcups2t64 2.4.10-3+deb13u2
ii libdbus-1-3 1.16.2-2
ii libhpmud0 3.22.10+dfsg0-8.1
ii libpython3.13 3.13.5-2
ii libsane-hpaio 3.22.10+dfsg0-8.1
ii libsane1 1.3.1-3+b1
ii lsb-base 11.6
ii printer-driver-hpcups 3.22.10+dfsg0-8.1
ii python3 3.13.5-1
ii python3-dbus 1.4.0-1
ii python3-gi 3.50.0-4+b1
ii python3-pexpect 4.9-3
ii python3-pil 11.1.0-5+b1
ii python3-reportlab 4.3.1-1
ii sysvinit-utils [lsb-base] 3.14-4
ii wget 1.25.0-2
ii xz-utils 5.8.1-1
Versions of packages hplip recommends:
ii avahi-daemon 0.8-16
ii pkexec 126-2
ii polkitd 126-2
ii printer-driver-postscript-hp 3.22.10+dfsg0-8.1
ii sane-utils 1.3.1-3+b1
Versions of packages hplip suggests:
pn hplip-doc <none>
pn hplip-gui <none>
pn python3-notify2 <none>
ii system-config-printer 1.5.18-4
-- no debconf information