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

David Fraser davidf at sjsoft.com
Tue Nov 9 05:08:17 EST 2004


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?

No, Apache normalises it to the POSIX convention (as is done in apache 
config files):
req.uri: /demo/css/nounderlinelinks.css
req.filename: C:/Temp/jSuite.py/jLogbook/html/demo
(where my handler is set with SetHandler in the demo directory, thats 
why its truncated)
Hope that helps

David


More information about the Mod_python mailing list