Apache specific versions of os.path(posixpath/ntpath) path manipulation 
functions.
----------------------------------------------------------------------------------

                 Key: MODPYTHON-192
                 URL: http://issues.apache.org/jira/browse/MODPYTHON-192
             Project: mod_python
          Issue Type: New Feature
          Components: core
            Reporter: Graham Dumpleton


The Apache req.filename attribute on UNIX is POSIX compatible and so the 
posixpath routines can be used to manipulate it. Most importantly, using 
os.path.normpath() produces a result which can be assigned back to req.filename.

On Win32 however, the ntpath routines produce paths which use back slashes and 
because req.filename is always maintained with forward slashes assigning the 
results of os.path.normpath() may cause issues if assigned back to req.filename 
when it is interpreted by Apache or handlers in other modules.

What may be useful is to add to 'mod_python.apache' equivalent functions to 
many of the functions in os.path but which when used on req.filename always 
result in paths which can in turn be assigned back to req.filename.

Thus, if assigning to req.filename, would use: 

  from mod_python import apache 

  req.filename = apache.normpath(__file__) 

If one simply assigned __file__ to req.filename on Win32, there would be back 
slashes in the path.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to