Skip to content

Commit ca5130c

Browse files
committed
Merged revisions 76210 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r76210 | senthil.kumaran | 2009-11-11 09:47:53 +0530 (Wed, 11 Nov 2009) | 10 lines Merged revisions 76208 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76208 | senthil.kumaran | 2009-11-11 07:04:44 +0530 (Wed, 11 Nov 2009) | 3 lines CGIHTTPRequestHandler.run_cgi() to use subprocess for Non Unix platforms. Fix based on Issue1235. ........ ................
1 parent c529c2f commit ca5130c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/http/server.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,24 +1063,24 @@ def run_cgi(self):
10631063
else:
10641064
# Non-Unix -- use subprocess
10651065
import subprocess
1066-
cmdline = scriptfile
1066+
cmdline = [scriptfile]
10671067
if self.is_python(scriptfile):
10681068
interp = sys.executable
10691069
if interp.lower().endswith("w.exe"):
10701070
# On Windows, use python.exe, not pythonw.exe
10711071
interp = interp[:-5] + interp[-4:]
1072-
cmdline = "%s -u %s" % (interp, cmdline)
1073-
if '=' not in query and '"' not in query:
1074-
cmdline = '%s "%s"' % (cmdline, query)
1075-
self.log_message("command: %s", cmdline)
1072+
cmdline = [interp, '-u'] + cmdline
1073+
if '=' not in query:
1074+
cmdline.append(query)
1075+
self.log_message("command: %s", subprocess.list2cmdline(cmdline))
10761076
try:
10771077
nbytes = int(length)
10781078
except (TypeError, ValueError):
10791079
nbytes = 0
10801080
p = subprocess.Popen(cmdline,
10811081
stdin=subprocess.PIPE,
10821082
stdout=subprocess.PIPE,
1083-
stderr=subprocess.PIPE,
1083+
stderr=subprocess.PIPE
10841084
)
10851085
if self.command.lower() == "post" and nbytes > 0:
10861086
data = self.rfile.read(nbytes)

0 commit comments

Comments
 (0)