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
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
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