get tests working on Python 3.13 and 3.14#145
Merged
grisha merged 3 commits intogrisha:mastergrisha/mod_python:masterfrom Nov 7, 2025
Merged
get tests working on Python 3.13 and 3.14#145grisha merged 3 commits intogrisha:mastergrisha/mod_python:masterfrom
grisha merged 3 commits intogrisha:mastergrisha/mod_python:masterfrom
Conversation
Owner
|
@saurik thank you very much for taking the time to sort this, looks reasonable to me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Python 3.13, an internal helper function was removed (as noted in #143). This helper function was not needed: I was able to normalize how the _apache module is registered, which also let me remove an additional special version case.
In Python 3.14, there was then another change to how the constant pool on a function is structured, which broke the feature in publisher that attempts to look up
__access__et al as local variables inside of functions being exported.While fixing the 3.14 co_flags/co_consts issue, I noticed that an existing comment in that same logic using sys.hexversion had the wrong version of Python... I not only fixed that, but figured out the root cause and added better documentation.
There seems to have been another change to Python 3.13, though: as far as I understand, the GIL implementation got a bit stricter, and so now the
PyOS_AfterFork_Childfunction in theap_hook_child_inithandler aborts and prints this error:I stared at this for a while and eventually came to think maybe (maybe?) we don't actually have to call this, given what is actually being imported? All of the tests pass without this function being called... but maybe that's nondeterministic?
Regardless, I've tested (requiring some haphazard patches to the configure and setup scripts, which don't actually work on all that many versions of Python) these changes on all of Python versions 2.7, 3.6, 3.10, 3.11, 3.12, 3.13, and 3.14.
(I only tested using the test suite in mod_python, though. I don't have production load on Python 3 currently... all of my stuff is still on Python 2.7, which is why I'm trying to help get mod_python ported to the most recent Python builds ;P.)