[Python-ideas] Suprocess functionality partitioning

Joshua Landau joshua.landau.ws at gmail.com
Wed Jun 12 21:44:55 CEST 2013


On 12 June 2013 20:32, anatoly techtonik <techtonik at gmail.com> wrote:
> Something needs to be done about subprocess API, which got overly
> complicated.
>
> The idea is to have:
>   shutil.run()  - run command through shell, unsafe
>   sys.run()    - run command directly in operating system, ?safe
>
> Both should be API compatible (unblocking stdin/stdout read etc.).
> Currently, subprocess calls are unreadable in any Python code - many
> conditions makes its behaviour hard to predict and memorize. By
> partitioning shell and out-of-shell execution, the documentation will be
> easier to grasp and reference to. Maybe it will be even possible to add
> some 2D table of various subprocess states that affect behavior.

Ranger (the best file manager ;P - http://ranger.nongnu.org/) has
shown that the current method is rather useful - a simple flag to run
in shell vs not is much easier to handle. I also, in my experience,
appreciate the quick toggling we have for utilising the two modes. I
also cannot agree that it would be easier to memorize the two
functions than the one with the flag.

So I'd be inclined to disagree with the proposal.


More information about the Python-ideas mailing list