[mod_python] Using mod_python Berkeley DB XML, XmlManager, with MacOSX Tiger/Leopard/SnowLeopard (again)

Graham Dumpleton graham.dumpleton at gmail.com
Tue Dec 15 21:30:29 EST 2009

If you are using mod_wsgi, why are you asking on the mod_python list?

This particular issue for mod_wsgi is documented in:


It explicitly tells you to use:

  WSGIApplicationGroup %{GLOBAL}

This is equivalent to the mod_python version of setting
PythonInterpreter to main_interpreter. Although the mod_python way
only works for mod_python, as the above only works for mod_wsgi.

Also be aware that if you still load mod_python at same time into
Apache, you might encounter over issues or loose some functionality of
mod_wsgi. If you no longer need mod_python, do not continue loading it
into Apache.


2009/12/16 Peter Robinson <p.m.robinson at bham.ac.uk>:
> Indeed I am using mod_wsgi. However, I cannot see how to set PythonInterpreter to 'main_interpreter'. So far as I can judge, this should be done through a declaration such as this in httpd.conf:
> <Location /SDPublisher>
>   SetHandler mod_wsgi
>   PythonInterpreter main_interpreter
> </Location>
> (according to what I could find at http://trac.edgewall.org/wiki/TracModPython)
> but this does not work, or rather Apache will not start with this included.
> help..!
> ________________________________________
> From: Graham Dumpleton [graham.dumpleton at gmail.com]
> Sent: Wednesday, December 16, 2009 12:34 AM
> To: Peter Robinson
> Cc: mod_python at modpython.org
> Subject: Re: [mod_python] Using mod_python Berkeley DB XML, XmlManager, with    MacOSX Tiger/Leopard/SnowLeopard (again)
> Are you definitely using PythonInterpreter set to 'main_interpreter'?
> Are you stuck with using mod_python? Any way you can use mod_wsgi?
> Since been discovered that even in main interpreter, mod_python's
> usage of GIL thread state APIs is wrong. The mod_wsgi module gets it
> right, although still have to tell mod_wsgi to use main interpreter as
> well to avoid other issues.
> Graham
> 2009/12/16 Peter Robinson <p.m.robinson at bham.ac.uk>:
>> Folks
>> Last March there was a thread on the problems of getting mod_python running
>> with Apache in Mac OSX, with a very thorough discussion by Graham Dumpleton
>> a.o. on how to make it work.  (see
>> http://www.modpython.org/pipermail/mod_python/2008-March/024955.html ; also
>> http://www.modpython.org/pipermail/mod_python/2007-October/024376.html).
>>  This discussion should have solved the issue forever.  Alas, it has not ..
>> for me anyway.
>> In trying to run mod_python with Berkeley DB XML, in the mod_wsgi
>> incarnation, an older problem has resurfaced.  This is to do with Apache
>> locking up when python tries to access the key XmlManager class in bdbxml. A
>> discussion on this list
>> http://www.modpython.org/pipermail/mod_python/2007-April/023445.html , under
>> the topic Global Interpreter Lock problem with Berkeley DB XML and
>> mod_python, dealt with this.  Graham (again) suggested two fixes:
>> 1. recompile bdbxml with the compiler option -DSWIG_PYTHON_NO_USE_GIL
>> 2.  reinstall the python bindings, editing dbxml/dist/s_swig so that
>> '-threads' isn't in swig_args for Python
>> I tried the second, and this changed nothing.  I cannot figure out how to do
>> the first (sh buildall.sh  --with-berkeleydb-conf=-DSWIG_PYTHON_NO_USE_GIL
>> and sh buildall.sh  --with-dbxml-conf=-DSWIG_PYTHON_NO_USE_GIL fail)...
>> so help would be really helpful!
>> I am trying to do this on SnowLeopard.

More information about the Mod_python mailing list