Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

get tests working on Python 3.13 and 3.14#145

Merged
grisha merged 3 commits intogrisha:mastergrisha/mod_python:masterfrom
saurik:mastersaurik/mod_python:masterCopy head branch name to clipboard
Nov 7, 2025
Merged

get tests working on Python 3.13 and 3.14#145
grisha merged 3 commits intogrisha:mastergrisha/mod_python:masterfrom
saurik:mastersaurik/mod_python:masterCopy head branch name to clipboard

Conversation

@saurik
Copy link
Contributor

@saurik saurik commented Nov 7, 2025

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_Child function in the ap_hook_child_init handler aborts and prints this error:

Fatal Python error: PyMutex_Unlock: unlocking mutex that is not locked
Python runtime state: initialized

Current thread 0x00007fb288b0b7c0 [apache2] (most recent call first):
  <no Python frame>

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.)

@grisha
Copy link
Owner

grisha commented Nov 7, 2025

@saurik thank you very much for taking the time to sort this, looks reasonable to me.

@grisha grisha merged commit b813aad into grisha:master Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.