]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #813200: Properly quote executable on Windows. Fixes #811082.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Oct 2003 18:08:03 +0000 (18:08 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Oct 2003 18:08:03 +0000 (18:08 +0000)
Lib/test/test_tempfile.py

index 8df3856039e77b1b22110e57c5875044a445c5e2..100bafaaa120aedc4bfcdc620ef91b2cc7fdca3c 100644 (file)
@@ -292,8 +292,12 @@ class test__mkstemp_inner(TC):
         tester = os.path.join(os.path.dirname(os.path.abspath(me)),
                               "tf_inherit_check.py")
 
-        retval = os.spawnl(os.P_WAIT, sys.executable,
-                           sys.executable, tester, v, fd)
+        # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted,
+        # but an arg with embedded spaces should be decorated with double
+        # quotes on each end
+        decorated = '"%s"' % sys.executable
+        tester = '"%s"' % tester
+        retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd)
         self.failIf(retval < 0,
                     "child process caught fatal signal %d" % -retval)
         self.failIf(retval > 0, "child process reports failure")