From: Gregory P. Smith Date: Sat, 17 May 2008 07:17:34 +0000 (+0000) Subject: fix issue2381: test_subprocess fails if your sys.executable is on a X-Git-Tag: v2.6b1~363 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af8a68733fe2e24384e7105745c504243ab8db29;p=python fix issue2381: test_subprocess fails if your sys.executable is on a path with a space in it. --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 3195339e9f..f31ce75ad0 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -534,7 +534,7 @@ class ProcessTestCase(unittest.TestCase): # args is a string f, fname = self.mkstemp() os.write(f, "#!/bin/sh\n") - os.write(f, "exec %s -c 'import sys; sys.exit(47)'\n" % + os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" % sys.executable) os.close(f) os.chmod(fname, 0700) @@ -576,7 +576,7 @@ class ProcessTestCase(unittest.TestCase): # call() function with string argument on UNIX f, fname = self.mkstemp() os.write(f, "#!/bin/sh\n") - os.write(f, "exec %s -c 'import sys; sys.exit(47)'\n" % + os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" % sys.executable) os.close(f) os.chmod(fname, 0700)