Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e29cd16

Browse files
committed
Merged revisions 76208 via svnmerge from
svn+ssh://[email protected]/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 d42bc51 commit e29cd16

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
@@ -1071,24 +1071,24 @@ def run_cgi(self):
10711071
else:
10721072
# Non-Unix -- use subprocess
10731073
import subprocess
1074-
cmdline = scriptfile
1074+
cmdline = [scriptfile]
10751075
if self.is_python(scriptfile):
10761076
interp = sys.executable
10771077
if interp.lower().endswith("w.exe"):
10781078
# On Windows, use python.exe, not pythonw.exe
10791079
interp = interp[:-5] + interp[-4:]
1080-
cmdline = "%s -u %s" % (interp, cmdline)
1081-
if '=' not in query and '"' not in query:
1082-
cmdline = '%s "%s"' % (cmdline, query)
1083-
self.log_message("command: %s", cmdline)
1080+
cmdline = [interp, '-u'] + cmdline
1081+
if '=' not in query:
1082+
cmdline.append(query)
1083+
self.log_message("command: %s", subprocess.list2cmdline(cmdline))
10841084
try:
10851085
nbytes = int(length)
10861086
except (TypeError, ValueError):
10871087
nbytes = 0
10881088
p = subprocess.Popen(cmdline,
10891089
stdin=subprocess.PIPE,
10901090
stdout=subprocess.PIPE,
1091-
stderr=subprocess.PIPE,
1091+
stderr=subprocess.PIPE
10921092
)
10931093
if self.command.lower() == "post" and nbytes > 0:
10941094
data = self.rfile.read(nbytes)

0 commit comments

Comments
 (0)