This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author majid
Recipients majid
Date 2007-12-21.21:57:21
SpamBayes Score 0.03135243
Marked as misclassified No
Message-id <1198274242.65.0.204698066624.issue1684@psf.upfronthosting.co.za>
In-reply-to
Content
The CGI specification does not specify the working directory the CGI is
invoked in, but the usual behavior is to use the directory containing
the script.

CGIHTTPServer should either change working directory by default (see
patch below), or offer a hook to be called before the exec() call to the
CGI.


*** /usr/local/lib/python2.4/CGIHTTPServer.py   Tue Apr  4 11:13:23 2006
--- kCGIHTTPServer.py   Fri Dec 21 13:31:40 2007
***************
*** 227,232 ****
--- 227,233 ----
                      pass
                  os.dup2(self.rfile.fileno(), 0)
                  os.dup2(self.wfile.fileno(), 1)
+                 os.chdir(os.path.dirname(scriptfile))
                  os.execve(scriptfile, args, os.environ)
              except:
                  self.server.handle_error(self.request,
self.client_address)
History
Date User Action Args
2007-12-21 21:57:22majidsetspambayes_score: 0.0313524 -> 0.03135243
recipients: + majid
2007-12-21 21:57:22majidsetspambayes_score: 0.0313524 -> 0.0313524
messageid: <1198274242.65.0.204698066624.issue1684@psf.upfronthosting.co.za>
2007-12-21 21:57:22majidlinkissue1684 messages
2007-12-21 21:57:21majidcreate