[Python-checkins] r76211 - in python/branches/release31-maint: Lib/http/server.py

senthil.kumaran python-checkins at python.org
Wed Nov 11 05:21:23 CET 2009


Author: senthil.kumaran
Date: Wed Nov 11 05:21:22 2009
New Revision: 76211

Log:
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. 
  ........
................


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Lib/http/server.py

Modified: python/branches/release31-maint/Lib/http/server.py
==============================================================================
--- python/branches/release31-maint/Lib/http/server.py	(original)
+++ python/branches/release31-maint/Lib/http/server.py	Wed Nov 11 05:21:22 2009
@@ -1063,16 +1063,16 @@
         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):
@@ -1080,7 +1080,7 @@
             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)


More information about the Python-checkins mailing list