This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mandel59
Recipients mandel59, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-07-07.10:30:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530959407.22.0.56676864532.issue34064@psf.upfronthosting.co.za>
In-reply-to
Content
In some cases, functions defined in subprocess modules pass wrong command to win32 shell.

Python 3.8.0a0 (heads/master:4629c0d531, Jul  7 2018, 16:37:33) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.check_output('cmd /c echo hello', shell=1)
b'hello"\r\n'

The result is as same as the following command run with cmd.exe:
C:\> %COMSPEC% /c "cmd /c echo hello"
hello"

Specifying /s switch fixes the issue:
C:\> %COMSPEC% /s /c "cmd /c echo hello"
hello
History
Date User Action Args
2018-07-07 10:30:07mandel59setrecipients: + mandel59, paul.moore, tim.golden, zach.ware, steve.dower
2018-07-07 10:30:07mandel59setmessageid: <1530959407.22.0.56676864532.issue34064@psf.upfronthosting.co.za>
2018-07-07 10:30:06mandel59linkissue34064 messages
2018-07-07 10:30:06mandel59create