Support freethreading Python #16
Copy link
Copy link
Open
Description
- Check the code for problematic places (how?)
- Add Py_MOD_GIL_NOT_USED
- Add freethreading jobs to CI (this requires tox 4.26+ available in Fedora 42+ and ideally adding freethreading Pythons to fedora-python-tox)
- Use pytest-run-parallel or alternative (passes for me locally)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
hroncok commentedon Nov 3, 2025
I talked about this with @encukou. Assuming the
crypt_rcall itself is thread safe1, the only potentially problematic part of the code isPy_TYPE(args[1])->tp_name:crypt_r/src/_crypt_r.c
Lines 37 to 40 in a52c167
__class__)->tp_nameon garbageThis is technically almost impossible to happen but it might :D
A solution is to use the
%Tformat here instead, which likely has the same problem, but the implementation is in Python and is no longer "our problem".%Twas added in Python 3.13.Footnotes
Where the
rstands for re-entrant, so we assume it is. ↩On Python 3.13.0a6+, use the %T format in exception messages