This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author grahamd
Recipients barry, christian.heimes, grahamd
Date 2008-10-25.02:40:41
SpamBayes Score 9.07779e-12
Marked as misclassified No
Message-id <>
I wouldn't be concerned about mod_python as likelihood that it will be ported is 
very low and even if it was it would be a long long way in the future. There is too 
much in mod_python itself unrelated to Python 3.0 that needs to be fixed before a 
port to Python 3.0 should be considered.

As to mod_wsgi, I can work around it in the short term by installing an 'atexit' 
module replacement in sub interpreters and avoid the problem.

As to a solution, yes, using PyInterpreterState would seem the most logical place, 
however there is a lot more to it than that.

Prior to Python 3.0, any callbacks registered with atexit module in sub interpreters 
weren't called anyway. This is because Py_EndInterpreter() didn't trigger them, nor 
did Py_Finalize(). The latter is in Python 3.0 at the moment, but as pointed out 
that is a problem in itself.

So, although one may register sub interpreter atexit callbacks against PyInterpreterState, what would be done with them. A decision would need to be made 
as to whether Py_EndInterpreter() should trigger them, or whether the status quo be 
maintained and nothing done with them.

In the short term, ie., for Python 3.0.0, the simplest thing to do may be to have 
functions of atexit module silently not actually do anything for sub interpreters.

The only place this would probably cause a problem would be for mod_wsgi where it 
was itself calling sys.exitfunc() on sub interpreters to ensure they were run. Since 
mod_wsgi has to change for Python 3.0 anyway, to call atexit._run_exitfuncs, with a 
bit more work mod_wsgi can just replace atexit module altogether in sub interpreter 
context and have mod_wsgi track the callback functions and trigger them.

By having atexit module ignore stuff for sub interpreters, at least for now avoid 
problem of callbacks against sub interpreters being execute by Py_Finalize() in main 
interpreter context.

And no I haven't looked at how PEP 3121 has changed things in Python 3.0. Up till 
now I hadn't seen any problems to suggest I may need to look at it.
Date User Action Args
2008-10-25 02:40:45grahamdsetrecipients: + grahamd, barry, christian.heimes
2008-10-25 02:40:44grahamdsetmessageid: <>
2008-10-25 02:40:43grahamdlinkissue4200 messages
2008-10-25 02:40:41grahamdcreate