[mod_python] patch to use Py_SetProgramName()

Glen W. Mabey Glen.Mabey at swri.org
Fri Mar 28 09:34:01 EDT 2008


On Thu, Mar 27, 2008 at 11:41:54PM -0500, Graham Dumpleton wrote:
> What I do know is the code in Python internals which uses that value
> and others such as PYTHONHOME is really convoluted, especially when it
> comes to Windows and MacOS X where I never did quite work out where it
> finds some stuff for determining prefix location.

Without knowing much about how it works, it's easy for me to believe
that it is convoluted.  Watching system calls via strace for a different
embedded application, I could see it searching around for a python 
executable, and that was a bit shocking.  That experience was what led
me to search for and then use the Py_SetProgramName() function.

> What I definitely don't want to do again is expose a
> WSGIPythonExecutable directive as it just caused confusion as people
> were using it for virtual environments when they should have been
> using WSGIPythonHome. It became an issue because people were blogging
> examples using WSGIPythonExecutable but then it wouldn't work on
> Windows or MacOS X.

BTW, how exactly does one specify an environment variable like PYTHONHOME 
within an apache config script?  

Thank you,
Glen Mabey


More information about the Mod_python mailing list