PEP 803: Py_GIL_DISABLED is tested prior to setting, in patchlevel.h #148267
Copy link
Copy link
Closed
Labels
buildThe build process and cross-buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Apr 8, 2026 - addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)buildThe build process and cross-buildThe build process and cross-build
on Apr 8, 2026 Thanks! Will fix; please define
Py_GIL_DISABLEDin 3.15.0a8.- added a commit that references this issue
on Apr 13, 2026 A fix is in #148302.
- added 2 commits that reference this issue
on Apr 16, 2026
Metadata
Metadata
Assignees
Labels
buildThe build process and cross-buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
I've been trying the PEP 803 changes in 3.15.0a8 with Meson, and I've hit the following build failure:
Per the description, setting
Py_LIMITED_API=0x030f0000when building with 3.15t should be sufficient to trigger abi3t build. However, the logic resides inpatchlevel.h:cpython/Include/patchlevel.h
Lines 76 to 79 in eab7dbd
which is included before
pyconfig.h:cpython/Include/Python.h
Lines 13 to 14 in eab7dbd
where
Py_GIL_DISABLEDis declared. As a result, the condition isn't true unless the user explicitly passes-DPy_GIL_DISABLED=1.CC @encukou @ngoldbaum
CPython versions tested on:
3.15, CPython main branch
Operating systems tested on:
Linux