[mod_python] Current working directory

Ragnar Kjørstad ragnark at zet.no
Tue Nov 6 14:45:53 EST 2001

On Mon, Nov 05, 2001 at 12:53:35AM -0500, Gregory (Grisha) Trubetskoy wrote:
> mod_python doesn't change the current directory, so it's whatever apache
> happens to have as cwd, probably the dir from which it was started.

In this case the cwd is different every time - seems to change with the
last object accessed by that particular child.

> really old versions used to behave exactly as you say, but this had to be
> removed, because changing cwd is not a thread-safe operation.

I don't understand this, because AFAIK there are no threads involved!
(Apache 1.3)
> my recommendation is to avoid chdir() and use full paths
full paths is not an option, because the same source-code is checked out
of CVS into multiple directories.

I suppose I can use __file__ to generate the full path, but it seems

Ragnar Kjørstad

More information about the Mod_python mailing list