[mod_python] Current Working Directory not set?

Sean Jamieson sean at barriescene.com
Fri Jan 27 16:01:22 EST 2006

Thanks for the quick response Deron.

Disreguarding the apache issue, what would be the problem with the 
working directory being set for publisher scripts? personally I'd expect 
to be able to refernce files relative to the script's directory.
I understand that for generaic handlers this wouldn't quite make sense; 
but for publisher and PSP (I don't know if its an issue for PSP, as I 
don't use it), it makes sense to me.

Any clarifiction would be appreciated.


Deron Meranda wrote:

>There are two problems with having the working directory set like you want
>1. URLs don't have to map to actual directories (and many mod_python
>users depend on this)
>2. The working directory is a process attribute.  Changing it would
>cause all kinds of problems in a multithreaded environment (depending
>on your Apache MPM)
>Generally, you should either set your PythonPath, or expect to deal
>with absolute pathnames or other such games.
>You may also want to look at the mod_python import_module() function,
>which lets you specify a path.  Also the request member req.filename
>may be useful to you was well.
>Deron Meranda

More information about the Mod_python mailing list