[issue7322] Socket timeout can cause file-like readline() method to lose data
Roy Smith
report at bugs.python.org
Sun Nov 21 03:36:06 CET 2010
Roy Smith <roy at panix.com> added the comment:
This is kind of ugly. On the one hand, I'm all for adding a check in makefile() to catch it being called on a non-blocking socket.
On the other hand, you are correct that a user could change the mode leter. Even if we added checks for this in socket.setblocking(), there's plenty of ways to get around that; it's easy to grab a raw file descriptor and do whatever you want with it behind the library's back.
On the third hand, maybe a check could be added to SocketIO.readinto() to verify that the socket was in blocking mode each time it was called?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7322>
_______________________________________
More information about the Python-bugs-list
mailing list