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

mod_python.psp should return 404 and not 500 when PSP file doesn't exist.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.8
    • 3.3.1
    • None
    • None

    Description

      When using mod_python.psp, if a request is made against a .psp file which doesn't exist, then a 500 error response is returned. If PythonDebug is on, the response is of the form:

      Mod_python error: "PythonHandler mod_python.psp"

      Traceback (most recent call last):

      File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/mod_python/apache.py", line 385, in HandlerDispatch
      result = object(req)

      File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/mod_python/psp.py", line 302, in handler
      p = PSP(req)

      File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/mod_python/psp.py", line 111, in _init_
      self.load_from_file()

      File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/mod_python/psp.py", line 164, in load_from_file
      raise ValueError, "%s is not a file" % filename

      ValueError: /Users/grahamd/Workspaces/testing/psp-1/bar.psp is not a file

      Instead of returning a 500 error, mod_python.psp should identify that target of request does not exist and return a 404 (NOT_FOUND) error response instead.

      Note that this will need to cope with requests against .psp_ file when PythonDebug on and SetHandler being used.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: