SF bug #770601: CGIHTTPServer and environment variables (bug + solution)
(contributed by Vincent Delft.)
The script updated os.environ but failed to pass the whole environment
to the child process (the CGI script).
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py
index 437ee80..7f481b7 100644
--- a/Lib/CGIHTTPServer.py
+++ b/Lib/CGIHTTPServer.py
@@ -215,7 +215,7 @@
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)