[mod_python] Multiple loading of same module with winnt MPM

Michael Sanders m.r.sanders at gmail.com
Wed May 9 08:46:46 EDT 2007


Environment:
- mod_python 3.3.1
- Apache 2.2.3 running on Windows XP
- PSP request handler

[Issue 4] described at the following link still appears to be present in 
mod_python 3.3.1:
http://www.dscpl.com.au/wiki/ModPython/Articles/ModuleImportingIsBroken#line-50

I have a PSP file that imports a module using 'apache.import_module'. If 
I re-start Apache and then fire two simultaneous requests at the PSP 
file, mod_python loads the module twice. (The module in question when 
imported  sets up a logging handler. The initial entry written by this 
module to the log file is duplicated and subsequent calls to this 
handler also give duplicate entries in the log file).

If I import the module using the standard Python 'import', this problem 
does not occur. Likewise, if I use the 'vampire.importModule' method, 
the problem does not occur. The issue only happens when using 
'apache.import_module'.

Has anyone else experienced this? Is there a fix?

Many thanks,
Michael Sanders


More information about the Mod_python mailing list