Antoine Pitrou <pit...@free.fr> added the comment:

Actually, the patch is enough to suppress the crash, but sendall() behaviour is 
buggy in another way: EINTR may be received as part of the select() call (on 
sockets with a timeout), in which case the loop will be exited early instead of 
retrying, losing track of the number of bytes written (something which the 
original patch aimed to avoid).

For example:

>>> def handler(*args): print (args)
... 
>>> signal.signal(signal.SIGALRM, handler)
0
>>> c, s = socket.socketpair()
>>> s.settimeout(60.0)
>>> signal.alarm(1); s.sendall(b"x" * (100 * 1024**2))
0
(14, <frame object at 0x2b8f220>)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.error: [Errno 4] Interrupted system call

----------

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

Reply via email to