Gregory P. Smith <g...@krypto.org> added the comment:

"""Generally there is no guarantee that a buffered object works "properly" when 
the raw IO object raises some exception intermittently"""

I disagree.  EINTR is a classic case of this and is something that buffering IO 
layers deal with all the time.  (readline is just one example of a buffering io 
layer)

if there is a timeout and we can't determine if there is enough data to return 
for readline, we should buffer it and not return.

maybe this means we need to disallow readline() with timeouts on unbuffered 
sockets since we can't determine if data will need to be buffered or not due to 
such a condition in advance.

The normal behavior for code calling readline() on a socket with a timeout is 
likely going to be to close it.  Anything else does not make much sense.  
(someone may try, but really they're writing their I/O code wrong if they are 
using a socket timeout a poor form of task switching ;)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7322>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to