diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2003-10-23 15:55:28 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2003-10-23 15:55:28 (GMT) |
commit | d4210bc7182c44db6a57d10e1769331b584311e7 (patch) | |
tree | a92dbda1d81f97fe33fd3857a531a21d8967839d /Lib/test | |
parent | ee950ff393aad46baf694c2df1981740925c29e1 (diff) | |
download | cpython-d4210bc7182c44db6a57d10e1769331b584311e7.zip cpython-d4210bc7182c44db6a57d10e1769331b584311e7.tar.gz cpython-d4210bc7182c44db6a57d10e1769331b584311e7.tar.bz2 |
Patch #813200: Quote executable path on Windows. Fixes #811082.
Backported to 2.3.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tempfile.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index d88d50f..d014ee8 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -293,8 +293,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") |