]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #813200: Quote executable path on Windows. Fixes #811082.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 23 Oct 2003 15:55:03 +0000 (15:55 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 23 Oct 2003 15:55:03 +0000 (15:55 +0000)
Lib/test/test_tempfile.py
Misc/NEWS

index 8df3856039e77b1b22110e57c5875044a445c5e2..62127d8c3fb70d3ad6485be4fabb18ba75472526 100644 (file)
@@ -292,8 +292,16 @@ 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
+        if sys.platform in ('win32'):
+            decorated = '"%s"' % sys.executable
+            tester = '"%s"' % tester
+        else:
+            decorated = sys.executable
+
+        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")
index 29cbdadd4fc7bd685b62a2b48b736b90ab41d3f5..7b010f1eadbb0c91d92ae556e3164f214e21fda9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -32,6 +32,8 @@ Extension modules
 Library
 -------
 
+- Bug #811082: test_tempfile fails if space in install directory.
+
 - Bug #780461: platform.mac_ver() raised MacOSError exception under OS X.
 
 - Bug #812202:  random.randrange() returned only even numbers