diff options
author | Guido van Rossum <guido@python.org> | 2001-08-07 19:55:10 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-08-07 19:55:10 +0000 |
commit | 16fd3381d4e5ba884c5b9e5135a1d7cc5e5e9a2c (patch) | |
tree | 45c1a53f38873d166be1b8d27ba57a4617112d17 /Lib/CGIHTTPServer.py | |
parent | 56b5fdd295d7e4be64036529cbbb6ffd252ac6bc (diff) | |
download | cpython-git-16fd3381d4e5ba884c5b9e5135a1d7cc5e5e9a2c.tar.gz |
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.
Diffstat (limited to 'Lib/CGIHTTPServer.py')
-rw-r--r-- | Lib/CGIHTTPServer.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index d6afaa105f..809cab73c8 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -223,7 +223,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): if interp.lower().endswith("w.exe"): # On Windows, use python.exe, not python.exe interp = interp[:-5] = interp[-4:] - cmdline = "%s %s" % (interp, cmdline) + 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) @@ -231,7 +231,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): nbytes = int(length) except: nbytes = 0 - fi, fo = os.popen2(cmdline) + fi, fo = os.popen2(cmdline, 'b') if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) fi.write(data) |