[mod_python] Handler publisher with multiple directories on the same tree

Mike Looijmans mike.looijmans at asml.com
Mon Sep 8 13:35:35 EST 2003

My guess:

If you wait for about a minute, the server will drop the keepalive
connection and another child process will handle your request. The effect is
that you probably get a brand new environment. Probably if you repeat often
enough, it will break completely when all childs are "loaded".

The problem is probably that you have equal named scripts in each directory.
So if you have


The first call will fetch /a/foo.py, and when you want to load the 'b'
version, it will just return the 'a' version because a 'foo' script is
already imported, even if pythonpath no longer contains the /a/ directory.

Scripts must have unique names, even when in different directories.

A good workaround is to use the "PythonInterpreter" directive, set it to per
directory or specify a unique interpreter name for each directory.
Each interpreter will have its own modules, so the "already loaded" effect
won't bite you.
This does, however, consume more memory.

This is also great for testing, you can add a "test" directory with a
different interpreter and have an environment completely set apart with it
own set of scripts and data and so.

>But I got a unpleasent surprise, that is, using browser, I access one of
>the projects subsection and everything is OK. After I got the page, I
>tried to access to another of the subsection and I got an 404, page not
>found. If I wait for a while (I don't know exactly, but something like
>one minute) and made reload on browser, I can now see this subsection.

The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.

More information about the Mod_python mailing list