hpmudext and scanext python extensions don't work with Python3.10
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
New
|
Undecided
|
Unassigned | ||
hplip (Fedora) |
Fix Released
|
Undecided
|
Bug Description
Hi,
we have a report in Fedora rawhide[1], where Python3.10 is already introduced, and hpfax crashes there with SystemError:
Truncated backtrace:
device.
Traceback (most recent call last):
File "/usr/lib/
probed_devices = device.
File "/usr/share/
result_code, data = hpmudext.
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
The change which the message mentions happened in Python3.10[2]. It is based on PEP 353[3], which forbids int as a sequence indice, and introduces Py_ssize_t indices (most times 'typedef'ed ssize_t from glibc).
The patch defines the mentioned macro in specific source files, and adds range checks for numeric variables coming from PyArg_ParseTuple(). It is because the length variable coming from the function is of Py_ssize_t, which is basically long int, and the hpmud functions uses int, so the value must be checked and adjusted in case it is bigger/smaller than INT_MAX/INT_MIN.
Would you mind merging the patch?
Thank you in advance,
Zdenek
[1] https:/
[2] https:/
[3] https:/
Changed in hplip (Fedora): | |
importance: | Unknown → Undecided |
status: | Unknown → In Progress |
Changed in hplip (Fedora): | |
status: | In Progress → Fix Released |