Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-192

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

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            grahamd Graham Phillip Dumpleton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: