[mod_python] Directory separator in uri/filename on Win32.

Dagur Páll Ammendrup dagurp at heimsnet.is
Tue Nov 9 05:28:45 EST 2004


If you're going to use os.path.join() or anything similar it doesn't 
matter what os.sep or os.path.sep are set to. Instead you will have to use

import posixpath
posixpath.join()

for the URI's to have the forward slash on windows.


Graham Dumpleton wrote:

> Can someone who uses mod_python on the Win32 platform, confirm for me 
> what
> directory separator is used in req.uri and req.filename on Win32.
>
> On UNIX (POSIX) one would get something like:
>
>   req.uri : /projects/vampire/index.html
>   req.filename = /usr/local/etc/httpd/htdocs/projects/vampire/index.html
>
> I am presuming that on Win32, the URI still uses a forward slash, but 
> that
> the filename will use backward slash in line with convention for platform
> and what os.path.sep is set to. Ie.,
>
>   req.uri : /projects/vampire/index.html
>   req.filename = \usr\local\etc\httpd\htdocs\projects\vampire\index.html
>
> Is this correct, or does Apache normalise it to the POSIX convention on
> the Win32 platform?
>
> -- 
> Graham Dumpleton (grahamd at dscpl.com.au)
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list