why does popen2 silently ignore IOError?

Graham Guttocks graham_guttocks at yahoo.co.nz
Wed Feb 20 13:28:53 EST 2002


Jörg Wölke <dvass at felis.uni-freiburg.de> wrote:

>> As you can see, no exceptions were raised despite the fact that
>> there is no such file as '/bin/nonexistent'.  Why is this?
>
> Because popen(3) returns a file descriptor or a Null-pointer?
> Try testing for None.

Greetings,

I don't quite understand, where should I test for None?

Also, this behavior really seems wrong to me.  I don't see how doing a
popen to a non-existent file, then writing to it and closing it all
succeed without raising any warnings or exceptions.  This seems very
dangerous to me.

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