Message319599
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. |
|
Date |
User |
Action |
Args |
2018-06-15 09:04:27 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, Anthony Sottile, Александр Бондарев |
2018-06-15 09:04:27 | eryksun | set | messageid: <1529053467.51.0.947875510639.issue25815@psf.upfronthosting.co.za> |
2018-06-15 09:04:27 | eryksun | link | issue25815 messages |
2018-06-15 09:04:27 | eryksun | create | |
|