Signals and readline()

Bob Alexander balexander at rsv.ricoh.com
Sun Apr 29 17:58:58 EDT 2001


I am observing that when a Python program (Unix) receives a signal while waiting for
a response from readline() from a pipe, an empty string is returned even though the
pipe is still open thus should not indicate EOF. After receiving the empty string,
normal IO continues.

What I would expect to happen in this case is to get a IOError exception with
errno=EINTR, but I get no exception.

The current behavior is bad because there is no way to distinguish between the
incorrect empty line and a real end of file.

This looks like a bug to me, but I thought I'd post to the list before submitting a
bug report as a sanity check. I can provide more details and a little test program to
reproduce the problem.


Bob





More information about the Python-list mailing list