Adding the functions as initfunc in module init table is of no use as
they aren't invoked when creating a sub interpreter.
One thing that does appear to work, although no idea of whether it is
correct way to solve problem, is to duplicate the builtin/sys
initialisation that occurs in Py_InitializeEx() function.
Attached diff shows nature of changes. Diff is bit messy as have left
existing code in there but #ifdef'd out.
Maybe this will give someone who knows how overall interpreter
initialisation is supposed to work a head start on coming up with proper
fix. But then it could be totally wrong as well.
At least with change as is, mod_wsgi works for sub interpreters now.
I'll do more work later on whether it is correct way to solve it. |