[SRU] python3-qrencode fails with SystemError about PY_SSIZE_T_CLEAN macro
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-qrencode (Debian) |
Fix Released
|
Unknown
|
|||
python-qrencode (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
python3-qrencode is completely unusable as it will crash with the following error whenever any user tries to use to generate a QR code:
File "/usr/lib/
version, size, data = _encode(data, version, level, hint, True)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
[ Test Plan ]
Add the following content in a python file:
import qrencode
(version, size, im) = qrencode.
im.show()
execute the python script. With the fixed package it will display the QR code.
[ Where problems could occur ]
It is only defining 'PY_SSIZE_T_CLEAN' before including Python.h as is suggested by upstream Python docs. There might be some adverse affect for this but the package is already unusable.
[ Other Info ]
The same fix from Debian is in Mantic.
Noble is also affected but I can not mark the bug status as confirmed. The NMU fix was lost with the update to 1.2-6. But I have now done a QA upload in Debian with the fix and also added an autopkgtest which has the same python script as the test plan. So, when 1.2-7 syncs, Noble will be fixed.
[ Original Bug Description ]
Python3 module qrencode does not allow generating QR codes using function encode().
The attached very simple script dies as follows:
$ ./python3-
Traceback (most recent call last):
File "/home/
qrencode.
File "/usr/lib/
version, size, data = _encode(data, version, level, hint, True)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
Package: python3-qrencode version 1.2-5build6, architecture amd64 on Ubuntu 22.04
Changed in python-qrencode (Ubuntu): | |
status: | New → Confirmed |
Changed in python-qrencode (Ubuntu Jammy): | |
status: | New → Confirmed |
Changed in python-qrencode (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in python-qrencode (Ubuntu Jammy): | |
status: | Confirmed → In Progress |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in python-qrencode (Debian): | |
status: | Unknown → Fix Released |
I have tested and can confirm the bug in Jammy. Also tested Focal and Mantic to confirm the issue is not reproduced.