Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a0a737

Browse files
committed
revert r83830, breaks tests on unixes
1 parent 4eb5fa5 commit 1a0a737

2 files changed

Lines changed: 1 addition & 43 deletions

File tree

Lib/subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
853853
startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW
854854
startupinfo.wShowWindow = _subprocess.SW_HIDE
855855
comspec = os.environ.get("COMSPEC", "cmd.exe")
856-
args = comspec + " /c " + '"%s"' % args
856+
args = comspec + " /c " + args
857857
if (_subprocess.GetVersion() >= 0x80000000 or
858858
os.path.basename(comspec).lower() == "command.com"):
859859
# Win9x, or using command.com on NT. We need to

Lib/test/test_subprocess.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,6 @@ def test_terminate(self):
10151015
self._kill_process('terminate')
10161016

10171017

1018-
10191018
# The module says:
10201019
# "NB This only works (and is only relevant) for UNIX."
10211020
#
@@ -1042,46 +1041,6 @@ def test_getoutput(self):
10421041
if dir is not None:
10431042
os.rmdir(dir)
10441043

1045-
class CommandsWithSpaces (BaseTestCase):
1046-
1047-
def setUp(self):
1048-
super().setUp()
1049-
f, fname = mkstemp(".py", "te st")
1050-
self.fname = fname.lower ()
1051-
os.write(f, b"import sys;"
1052-
b"sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))"
1053-
)
1054-
os.close(f)
1055-
1056-
def tearDown(self):
1057-
os.remove(self.fname)
1058-
super().tearDown()
1059-
1060-
def with_spaces(self, *args, **kwargs):
1061-
kwargs['stdout'] = subprocess.PIPE
1062-
p = subprocess.Popen(*args, **kwargs)
1063-
self.assertEqual(
1064-
p.stdout.read ().decode("mbcs"),
1065-
"2 [%r, 'ab cd']" % self.fname
1066-
)
1067-
1068-
def test_shell_string_with_spaces(self):
1069-
# call() function with string argument with spaces on Windows
1070-
self.with_spaces('"%s" "%s"' % (self.fname, "ab cd"), shell=1)
1071-
1072-
def test_shell_sequence_with_spaces(self):
1073-
# call() function with sequence argument with spaces on Windows
1074-
self.with_spaces([self.fname, "ab cd"], shell=1)
1075-
1076-
def test_noshell_string_with_spaces(self):
1077-
# call() function with string argument with spaces on Windows
1078-
self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
1079-
"ab cd"))
1080-
1081-
def test_noshell_sequence_with_spaces(self):
1082-
# call() function with sequence argument with spaces on Windows
1083-
self.with_spaces([sys.executable, self.fname, "ab cd"])
1084-
10851044

10861045
@unittest.skipUnless(getattr(subprocess, '_has_poll', False),
10871046
"poll system call not supported")
@@ -1134,7 +1093,6 @@ def test_main():
11341093
Win32ProcessTestCase,
11351094
ProcessTestCasePOSIXPurePython,
11361095
CommandTests,
1137-
CommandsWithSpaces,
11381096
ProcessTestCaseNoPoll,
11391097
HelperFunctionTests)
11401098

0 commit comments

Comments
 (0)