why does popen2 silently ignore IOError?

Graham Guttocks graham_guttocks at yahoo.co.nz
Wed Feb 20 19:53:40 EST 2002


"Donn Cave" <donn at u.washington.edu> wrote:

> Where's the IOError?

No IOError, I just meant that IMO, an IOError should have been raised.

> in the general sense that it does not raise an exception in the case
> of a non-zero exit from the child process.

[...]

> I personally prefer to get an exception, with value from stderr
> output

This was what I was looking for.  It sounds like it isn't possible.

I thought what I wanted was simple.  I'm sending mail by opening a
pipe to /usr/sbin/sendmail -- if that fails for whatever reason (e.g,
sendmail program is missing) I want an exception raised with some
indication of the problem, instead of the current silent failure.

Is there any way to do this in Python?  Any example code to get me
started?

Regards,
Graham


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com




More information about the Python-list mailing list