summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2009-11-11 04:17:53 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2009-11-11 04:17:53 (GMT)
commite29cd162edb5ed09caf265a4dfa5aceb04b9c957 (patch)
tree424fae4266e157c790aa4615ab65fbf9d3cbaaad /Lib/http
parentd42bc519d2e15d1ecca8f6fcee65113b64a4131b (diff)
downloadcpython-e29cd162edb5ed09caf265a4dfa5aceb04b9c957.zip
cpython-e29cd162edb5ed09caf265a4dfa5aceb04b9c957.tar.gz
cpython-e29cd162edb5ed09caf265a4dfa5aceb04b9c957.tar.bz2
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. ........
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/server.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index c9cfe9b..1e640fa 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -1071,16 +1071,16 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
else:
# Non-Unix -- use subprocess
import subprocess
- cmdline = scriptfile
+ cmdline = [scriptfile]
if self.is_python(scriptfile):
interp = sys.executable
if interp.lower().endswith("w.exe"):
# On Windows, use python.exe, not pythonw.exe
interp = interp[:-5] + interp[-4:]
- cmdline = "%s -u %s" % (interp, cmdline)
- if '=' not in query and '"' not in query:
- cmdline = '%s "%s"' % (cmdline, query)
- self.log_message("command: %s", cmdline)
+ cmdline = [interp, '-u'] + cmdline
+ if '=' not in query:
+ cmdline.append(query)
+ self.log_message("command: %s", subprocess.list2cmdline(cmdline))
try:
nbytes = int(length)
except (TypeError, ValueError):
@@ -1088,7 +1088,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
p = subprocess.Popen(cmdline,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
+ stderr=subprocess.PIPE
)
if self.command.lower() == "post" and nbytes > 0:
data = self.rfile.read(nbytes)