[mod_python] sys.path problem

AJ Coon ajcoon at gmail.com
Wed Feb 20 20:12:22 EST 2008


Hello,

I have an issue with two different handlers running on the same apache
server.

They seem to be "sharing" (read: overwriting each other's) sys.path.  I'm
printing the output of sys.path before any of my import statements in each
handler to verify this.  It seems like I can make several requests to
handler "A" with no problem, but then if handler "B" is called, and then
subsequently handler "A" is called again, sys.path has been overwritten by
handler "B" for handler "A".  Ugh.

- Each handler is defined in its own virtual host in apache.
- Each handler is named differently (i.e. PythonHandler handlerA,
PythonHandler handlerB)
- Each handler runs in its own sub-directory (i.e. /var/handlerA,
/var/handlerB)
- In the doc root of each handler's virtual host, I have a .htaccess file
that contains a PythonInterpreter directive, defining a different named
interpreter to be used (i.e. PythonInterpreter InterpA, PythonInterpreter
InterpB)


How can I ensure that each handler has its own sys.path that is not affected
by the other handler, ever?


I am running on the following stack:

Apache/2.0.54 (Debian GNU/Linux) mod_python/3.3.1 Python/2.3.5
mod_ssl/2.0.54 OpenSSL/0.9.7e


Thanks,
-aj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080220/b489f400/attachment.html


More information about the Mod_python mailing list