mirror of
https://github.com/python/cpython.git
synced 2025-10-26 00:08:32 +00:00
Apply two small changes to the Windows code, according to SF bug
#427345. These are supposed to support binary data and avoid buffering problems on Windows.
This commit is contained in:
parent
56b5fdd295
commit
16fd3381d4
1 changed files with 2 additions and 2 deletions
|
|
@ -223,7 +223,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
if interp.lower().endswith("w.exe"):
|
if interp.lower().endswith("w.exe"):
|
||||||
# On Windows, use python.exe, not python.exe
|
# On Windows, use python.exe, not python.exe
|
||||||
interp = interp[:-5] = interp[-4:]
|
interp = interp[:-5] = interp[-4:]
|
||||||
cmdline = "%s %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_error("command: %s", cmdline)
|
||||||
|
|
@ -231,7 +231,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
nbytes = int(length)
|
nbytes = int(length)
|
||||||
except:
|
except:
|
||||||
nbytes = 0
|
nbytes = 0
|
||||||
fi, fo = os.popen2(cmdline)
|
fi, fo = os.popen2(cmdline, 'b')
|
||||||
if self.command.lower() == "post" and nbytes > 0:
|
if self.command.lower() == "post" and nbytes > 0:
|
||||||
data = self.rfile.read(nbytes)
|
data = self.rfile.read(nbytes)
|
||||||
fi.write(data)
|
fi.write(data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue