[issue39692] Subprocess using list vs string

2020-02-20 Thread Jonny Weese
Jonny Weese added the comment: > So the command_string provided (the first word or the first quoted > expression) is interpreted as a shell program, and this program is invoked > with the remaining words as its arguments. Correct. > As you say, simply slapping quotes around

[issue39692] Subprocess using list vs string

2020-02-20 Thread Jonny Weese
Jonny Weese added the comment: > it seems strange/wrong to invoke an executable via "bash -c executable arg1 > arg2", rather than just "executable arg1 arg2"! I agree it's strange to invoke a single executable that way, but remember that -c allows a string o

[issue39692] Subprocess using list vs string

2020-02-20 Thread Jonny Weese
Jonny Weese added the comment: I believe this behavior is expected (at least in posix-land). Lib/subprocess.py L1702 shows that whenever shell=True, the args that are constructed are [unix_shell, "-c"] + args. And so we can reproduce your behavior just using a regular shell