summaryrefslogtreecommitdiffstats
path: root/Lib/CGIHTTPServer.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-17 06:45:56 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-17 06:45:56 (GMT)
commitbcbdc95e90794794081927b81006ce8563974969 (patch)
treee8071ff4928527396c666a138490938d1057da66 /Lib/CGIHTTPServer.py
parentb33e789cb85647da55a89b5f23302ce011859faf (diff)
downloadcpython-bcbdc95e90794794081927b81006ce8563974969.zip
cpython-bcbdc95e90794794081927b81006ce8563974969.tar.gz
cpython-bcbdc95e90794794081927b81006ce8563974969.tar.bz2
SF patch #467430.
- replace some log_error() calls with log_message() - flush self.rfile before forking too (hope this works on Windows)
Diffstat (limited to 'Lib/CGIHTTPServer.py')
-rw-r--r--Lib/CGIHTTPServer.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py
index 809cab7..e8abd22 100644
--- a/Lib/CGIHTTPServer.py
+++ b/Lib/CGIHTTPServer.py
@@ -192,6 +192,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if '=' not in decoded_query:
args.append(decoded_query)
nobody = nobody_uid()
+ self.rfile.flush() # Always flush before forking
self.wfile.flush() # Always flush before forking
pid = os.fork()
if pid != 0:
@@ -226,7 +227,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
cmdline = "%s -u %s" % (interp, cmdline)
if '=' not in query and '"' not in query:
cmdline = '%s "%s"' % (cmdline, query)
- self.log_error("command: %s", cmdline)
+ self.log_message("command: %s", cmdline)
try:
nbytes = int(length)
except:
@@ -241,7 +242,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if sts:
self.log_error("CGI script exit status %#x", sts)
else:
- self.log_error("CGI script exited OK")
+ self.log_message("CGI script exited OK")
else:
# Other O.S. -- execute script in this process
@@ -266,7 +267,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
except SystemExit, sts:
self.log_error("CGI script exit status %s", str(sts))
else:
- self.log_error("CGI script exited OK")
+ self.log_message("CGI script exited OK")
nobody = None