From: Martin v. Löwis Date: Thu, 23 Oct 2003 15:55:03 +0000 (+0000) Subject: Patch #813200: Quote executable path on Windows. Fixes #811082. X-Git-Tag: v2.3.3c1~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f73fa5465dd2427d721b6934a184153db781f0cd;p=thirdparty%2FPython%2Fcpython.git Patch #813200: Quote executable path on Windows. Fixes #811082. --- diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 8df3856039e7..62127d8c3fb7 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -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") diff --git a/Misc/NEWS b/Misc/NEWS index 29cbdadd4fc7..7b010f1eadbb 100644 --- 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