Martin Panter added the comment:
According to strace, Python 3 is calling send(-1, ...):
sendto(-1, "x", 1, 0, NULL, 0) = -1 EBADF (Bad file descriptor)
A related discrepancy between Python 2 and 3 is how the socket.makefile()
objects affect the original socket. In Python 2:
>>> f = sock.makefile("wb")
>>> sock.close() # Should “close” Python’s sock object, but not f
>>> sock.send(b"x")
socket.error: [Errno 9] Bad file descriptor
In Python 3:
>>> sock.send(b"x") # Actually sent to remote end!
1
----------
nosy: +martin.panter
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13344>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com