New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subprocess: move shell arguments to a separate keyword param #57406
Comments
subprocess.Popen(args, shell=shell) is implicitly inconsistent on Unix:
I propose to make consistent behaviour - require args to be a list, and pass shell options in a separate shell_args keyword argument. If it not for python4, then perhaps it can be implemented in PopenShell() and PopenSystem() functions. This will also require unification of behaviour across platforms. |
Did you read the issue bpo-7839? |
No. I won't be fixed in 2.7 anyway, and if it can not be fixed, it should be documented at least. |
Oh, sorry - my attention span is limited under time pressure. bpo-7839 is related, of course. There is a lot of comments, so I'll take a look at it later. |
I don't think you can tighten the API at this point. We could however make Popen complain when options are going to be thrown away. Or it could be made more liberal about what is accepts (running shlex on string input or join on list input as needed). |
List not only needs to be joined, it should be quoted as well. But the biggest problem will be the change of behavior between Python versions which may confuse users even more. Perhaps it's a good time to start embedding 'best practice' recipes in manual. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: