Eryk Sun <eryk...@gmail.com> added the comment:

With a stock Windows system, `subprocess.check_output(['echo', "'hello'"])` 
fails because there is no "echo.exe". That's a 3rd party program that you 
installed. `subprocess.check_output("echo 'hello'", shell=True)` uses the CMD 
shell's internal `echo` command, which doesn't strip quotes from the string.

subprocess.list2cmdline implements quoting that's meant for applications that 
use the VC++ [w]main argv array, or the CommandLineToArgvW WinAPI function. It 
can't take into account custom command-line parsing of all applications. If 
this echo.exe doesn't work right with an args list, then use a custom command 
line -- *without* shell=True.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue25815>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to