[issue29343] sock.close() raises OSError EBADF when socket's fd is closed

Antoine Pitrou report at bugs.python.org
Sun Jan 22 08:23:20 EST 2017


Antoine Pitrou added the comment:

Closing a socket whose fd has already been closed before is a bug waiting to happen.  Indeed it feels harmless if you just get a EBADF, but if the given fd gets reused in the meantime for another file or socket, your close() method is going to close a resource which doesn't belong to the socket (and then the fd can be reused for yet another resource without its owner knowing, and confusion/hilarity ensues).

----------
nosy: +neologix, pitrou

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


More information about the Python-bugs-list mailing list