[issue10644] socket loses data, calling send()/sendall() on invalid socket does not report error and returns all bytes as written

diekmann report at bugs.python.org
Wed Dec 8 11:17:10 CET 2010


diekmann <diekmann at in.tum.de> added the comment:

The Documentation states:

socket.sendall(bytes[, flags])¶
    Send data to the socket. The socket must be connected to a remote socket. The optional flags argument has the same meaning as for recv() above. Unlike send(), this method continues to send data from bytes until either all data has been sent or an error occurs. None is returned on success. On error, an exception is raised, and there is no way to determine how much data, if any, was successfully sent.

This is not consistent with the results reproduced above, however, the results from above are exactly what should happen. Maybe there should be a remark, that the return value of sendall (and send) may be system dependent. Or a patch which enforces the documented behviour of sendall, regardless of the operating system would be a nice future feature?

----------

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


More information about the Python-bugs-list mailing list