]> granicus.if.org Git - python/commitdiff
SF bug #770601: CGIHTTPServer and environment variables (bug + solution)
authorRaymond Hettinger <python@rcn.com>
Mon, 14 Jul 2003 06:56:32 +0000 (06:56 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 14 Jul 2003 06:56:32 +0000 (06:56 +0000)
(contributed by Vincent Delft.)

The script updated os.environ but failed to pass the whole environment
to the child process (the CGI script).

Lib/CGIHTTPServer.py

index 437ee80fcc2cf962718bd87703813a81121a9b19..7f481b7b3cf575973948a9e213caf0018db5aa88 100644 (file)
@@ -215,7 +215,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
                     pass
                 os.dup2(self.rfile.fileno(), 0)
                 os.dup2(self.wfile.fileno(), 1)
-                os.execve(scriptfile, args, env)
+                os.execve(scriptfile, args, os.environ)
             except:
                 self.server.handle_error(self.request, self.client_address)
                 os._exit(127)