[issue7322] Socket timeout can cause file-like readline() method to lose data

David Beazley report at bugs.python.org
Thu Jan 13 15:10:32 CET 2011


David Beazley <dave at dabeaz.com> added the comment:

Have any other programming environments ever had a feature where a socket timeout returns an exception containing partial data?    I'm not aware of one offhand and speaking as a systems programmer, something like this might be somewhat unexpected.

My concern is that in the presence of timeouts, the programmer will be forced to reassemble the message themselves from fragments returned in the exception.  However, one reason for using readline() in the first place is precisely so that you don't have to do that sort of thing.

Is there any reason why the input buffer can't be preserved across calls?   You've already got a file-like wrapper around the socket.  Just keep the unconsumed buffer in that instance.

----------
nosy: +dabeaz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7322>
_______________________________________


More information about the Python-bugs-list mailing list