Simple process IO capture (Was: "shell-commands" and python!) - process.py (0/1)

Greg Weeks weeks at vitus.scs.agilent.com
Tue Sep 25 22:31:22 EDT 2001


I guess there isn't a lot of interest in this.  Still, I'm interested.

Donn Cave (donn at drizzle.com) wrote:
: Are you thinking about reading stderr for use in the exception?

stderr is a messy issue, because there is no agreement on what stderr is
for.  Some people use stderr only for fatal error messages.  Othere use
stderr -- now renamed "diagnostic output" -- for any messages whatsoever
intended for human readers.  The first group is like to want exceptions to
include stderr text; the second group isn't.

I'm in the first group, and I'm content to write a private utility that
handles stderr as if it were used only for fatal error messages (even
though I know this will get me into trouble with certain programs).  But
I'd be hard-pressed to come up with a general solution.  Look at the
evolution of the popen2 module, for instance.  And if you have a pipeline
with multiple processes, it just gets that much worse.

Greg



More information about the Python-list mailing list