summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-08-20 23:59:33 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-08-20 23:59:33 (GMT)
commit8df7f2ba43efcdf41ca2ca4e971fc8d158566ff8 (patch)
treee016dbb7e46772e6a56c89ca93636aab56b11771
parent96303ce055e0bdc1b5f53f38bd424e747e289621 (diff)
downloadcpython-8df7f2ba43efcdf41ca2ca4e971fc8d158566ff8.zip
cpython-8df7f2ba43efcdf41ca2ca4e971fc8d158566ff8.tar.gz
cpython-8df7f2ba43efcdf41ca2ca4e971fc8d158566ff8.tar.bz2
SF 595846. Backport deltas from 1.26 to 1.28.
-rw-r--r--Lib/CGIHTTPServer.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py
index 76570d2..2106a53 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, "")
+ os.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