diff options
author | Guido van Rossum <guido@python.org> | 2002-08-20 19:55:06 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-08-20 19:55:06 +0000 |
commit | 0bd783228538b761e9b75cea3f42931c2d4ba6c6 (patch) | |
tree | 830eb645cd6d01159cbdc51d51477e3db46da3db /Lib/CGIHTTPServer.py | |
parent | 0d2d87d202c62182983c9d7edce978a0c9c9aad1 (diff) | |
download | cpython-git-0bd783228538b761e9b75cea3f42931c2d4ba6c6.tar.gz |
SF patch 595846 by Brett Cannon: Update environ for CGIHTTPServer.py
This patch causes CGIHTTPServer to update os.environ regardless of how
it tries to handle calls (fork, popen*, etc.).
Backport bugfix candidate.
Diffstat (limited to 'Lib/CGIHTTPServer.py')
-rw-r--r-- | Lib/CGIHTTPServer.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index 0279117c7a..eb1ee198b3 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -182,6 +182,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE'): env.setdefault(k, "") + so.environ.update(env) self.send_response(200, "Script output follows") @@ -221,7 +222,6 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): popenx = os.popen3 else: popenx = os.popen2 - os.environ.update(env) cmdline = scriptfile if self.is_python(scriptfile): interp = sys.executable @@ -259,7 +259,6 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): else: # Other O.S. -- execute script in this process - os.environ.update(env) save_argv = sys.argv save_stdin = sys.stdin save_stdout = sys.stdout |