[mod_python] Bizarre problems with rewriting URLs?

Graham Dumpleton grahamd at dscpl.com.au
Sun Oct 15 21:31:07 EDT 2006


Aaron Gallagher wrote ..
> I'm getting a slough of bizarre problems on one of my Apache servers, 
> and everything is perfect on the other. The version is the same, and  
> most of the configuration is the same. Namely, I'm trying to figure  
> out why mod_python will sometimes randomly send headers twice.
> 
> I'm running mod_python handlers in three different locations, and it  
> seems like it'll randomly decide to run out of another location  
> rather than where the request is asking for. I mean, the top sys.path 
> entry in mod_python should always be the directory of the nearest  
> handler, right?

No. It is a known problem with mod_python that the order of directories in
sys.path can be random. As a result, if you use the same module name in
different handler directories, you can get strange things happening, more so if
you are using the worker MPM on UNIX. See:

  http://www.dscpl.com.au/wiki/ModPython/Articles/ModuleImportingIsBroken

for a full list of module importer problems.

> The server that doesn't have any URL rewriting done never has any  
> problems whatsoever, but the one that does is the one with these  
> bizarre problems. I've compared configuration files, and they're both 
> almost exactly the same. I can't find any major thing that's  
> different between the two other than the rewriting. I'm using  
> mod_rewrite to have a dynamic virtual host map. and can post the  
> rules and conditions if necessary.

By all means post that part of your configuration which is relevant, but also
state which version of mod_python you are using. Also make it clear whether you
have different parts of the URL namespace with their own PythonHandler
directives and whether you have separated them if possible by tagging them
against different Python interpreter instances using PythonInterpreter
directive or otherwise.

Graham


More information about the Mod_python mailing list