Commit bcbdc95e authored by Guido van Rossum's avatar Guido van Rossum

SF patch #467430.

- replace some log_error() calls with log_message()

- flush self.rfile before forking too (hope this works on Windows)
parent b33e789c
...@@ -192,6 +192,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): ...@@ -192,6 +192,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if '=' not in decoded_query: if '=' not in decoded_query:
args.append(decoded_query) args.append(decoded_query)
nobody = nobody_uid() nobody = nobody_uid()
self.rfile.flush() # Always flush before forking
self.wfile.flush() # Always flush before forking self.wfile.flush() # Always flush before forking
pid = os.fork() pid = os.fork()
if pid != 0: if pid != 0:
...@@ -226,7 +227,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): ...@@ -226,7 +227,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
cmdline = "%s -u %s" % (interp, cmdline) cmdline = "%s -u %s" % (interp, cmdline)
if '=' not in query and '"' not in query: if '=' not in query and '"' not in query:
cmdline = '%s "%s"' % (cmdline, query) cmdline = '%s "%s"' % (cmdline, query)
self.log_error("command: %s", cmdline) self.log_message("command: %s", cmdline)
try: try:
nbytes = int(length) nbytes = int(length)
except: except:
...@@ -241,7 +242,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): ...@@ -241,7 +242,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if sts: if sts:
self.log_error("CGI script exit status %#x", sts) self.log_error("CGI script exit status %#x", sts)
else: else:
self.log_error("CGI script exited OK") self.log_message("CGI script exited OK")
else: else:
# Other O.S. -- execute script in this process # Other O.S. -- execute script in this process
...@@ -266,7 +267,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): ...@@ -266,7 +267,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
except SystemExit, sts: except SystemExit, sts:
self.log_error("CGI script exit status %s", str(sts)) self.log_error("CGI script exit status %s", str(sts))
else: else:
self.log_error("CGI script exited OK") self.log_message("CGI script exited OK")
nobody = None nobody = None
......
...@@ -301,6 +301,7 @@ Oscar Nierstrasz ...@@ -301,6 +301,7 @@ Oscar Nierstrasz
Hrvoje Niksic Hrvoje Niksic
Bill Noon Bill Noon
Stefan Norberg Stefan Norberg
Joe Norton
Neal Norwitz Neal Norwitz
Jeffrey Ollie Jeffrey Ollie
Nigel O'Brian Nigel O'Brian
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment