[Python-ideas] shutil.runret and shutil.runout

Mike Meyer mwm at mired.org
Fri Feb 24 12:25:25 CET 2012

On Fri, 24 Feb 2012 12:10:08 +0100
Tarek Ziadé <ziade.tarek at gmail.com> wrote:
> On Fri, Feb 24, 2012 at 11:52 AM, anatoly techtonik <techtonik at gmail.com>wrote:
> > Hello,
> > subprocess is low level, cryptic, does too much, with poor usability,
> > i.e. "don't make me think" is not about it. I don't know about you,
> > but I can hardly write any subprocess call without spending at least
> > 5-10 meditating over the documentation. So, I propose two high level
> > KISS functions for shell utils (shutil) module:
> > runret(command)   - run command through shell, return ret code
> mmm you are describing subprocess.call()  here... I don't see how this new
> command makes thing better, besides shell=True.

The stated purpose of the new functions is to allow people to run
shell commands without thinking about them. That's a bad idea (isn't
most programming without thinking about it?). The first problem is
that it's a great way to add data injection vulnerabilities to your
application. It's also a good way to introduce bugs in your
application when asked to (for instance) process user-provided file


Mike Meyer <mwm at mired.org>		http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

More information about the Python-ideas mailing list