Question about pipes/os.popen
Donn Cave
donn at u.washington.edu
Fri Sep 15 16:42:17 EDT 2006
In article <mailman.145.1158345496.10491.python-list at python.org>,
Steve Holden <steve at holdenweb.com> wrote:
[ someone's command that fails, run in popen ]
> > cmd.read()
> >
> > This returns output of "".
...
> > I'm not sure what I'm doing wrong here.
> >
> Probably expecting sudo to read the standard input for its password.
Also probably having inflated expectations for popen(),
and other related functions for that matter. Where in
most Python library functions you can expect an exception
when something fails, that doesn't apply to failures in
shell commands. Not that it strictly couldn't be done,
but on the whole I haven't noticed that anyone cares.
Donn Cave, donn at u.washington.edu
More information about the Python-list
mailing list