diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-08-08 19:14:28 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-08-08 19:14:28 +0000 |
commit | 718f22237233dfa58f5e575e7e80cdb7344f8807 (patch) | |
tree | d9e4a4f4a58f6f68eb1f809de967720f4c8c544f /Lib | |
parent | 6eccb79aa376691e6f5116b121fea49737e3e552 (diff) | |
download | cpython-git-718f22237233dfa58f5e575e7e80cdb7344f8807.tar.gz |
revert 83832; unix test breakage
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/subprocess.py | 2 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 44 |
2 files changed, 2 insertions, 44 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 247824b013..395b7a3400 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -853,7 +853,7 @@ class Popen(object): startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW startupinfo.wShowWindow = _subprocess.SW_HIDE comspec = os.environ.get("COMSPEC", "cmd.exe") - args = comspec + " /c " + '"%s"' % args + args = comspec + " /c " + args if (_subprocess.GetVersion() >= 0x80000000L or os.path.basename(comspec).lower() == "command.com"): # Win9x, or using command.com on NT. We need to diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index ccb7a690ff..15ca19753f 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -872,54 +872,12 @@ class HelperFunctionTests(unittest.TestCase): self.assertEqual([(256, 999), (666,), (666,)], record_calls) -@unittest.skipUnless(mswindows, "mswindows only") -class CommandsWithSpaces (BaseTestCase): - - def setUp(self): - super(CommandsWithSpaces, self).setUp() - f, fname = mkstemp(".py", "te st") - self.fname = fname.lower () - os.write(f, b"import sys;" - b"sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))" - ) - os.close(f) - - def tearDown(self): - os.remove(self.fname) - super(CommandsWithSpaces, self).tearDown() - - def with_spaces(self, *args, **kwargs): - kwargs['stdout'] = subprocess.PIPE - p = subprocess.Popen(*args, **kwargs) - self.assertEqual( - p.stdout.read ().decode("mbcs"), - "2 [%r, 'ab cd']" % self.fname - ) - - def test_shell_string_with_spaces(self): - # call() function with string argument with spaces on Windows - self.with_spaces('"%s" "%s"' % (self.fname, "ab cd"), shell=1) - - def test_shell_sequence_with_spaces(self): - # call() function with sequence argument with spaces on Windows - self.with_spaces([self.fname, "ab cd"], shell=1) - - def test_noshell_string_with_spaces(self): - # call() function with string argument with spaces on Windows - self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname, - "ab cd")) - - def test_noshell_sequence_with_spaces(self): - # call() function with sequence argument with spaces on Windows - self.with_spaces([sys.executable, self.fname, "ab cd"]) - def test_main(): unit_tests = (ProcessTestCase, POSIXProcessTestCase, Win32ProcessTestCase, ProcessTestCaseNoPoll, - HelperFunctionTests, - CommandsWithSpaces) + HelperFunctionTests) test_support.run_unittest(*unit_tests) test_support.reap_children() |