[New-bugs-announce] [issue39239] select.epoll.unregister(fd) should not ignore EBADF
report at bugs.python.org
Mon Jan 6 18:34:48 EST 2020
New submission from STINNER Victor <vstinner at python.org>:
The select.epoll.unregister(fd) method currently ignores EBADF error if the file descriptor fd is invalid.
I'm surprised by this undocumented behavior:
This behavior may lead to bugs if the file descriptor number has been recycled in the meanwhile. I'm not sure that it's a good idea to silently ignore the error.
See bpo-18748 for a similar issue: "io.IOBase destructor silence I/O error on close() by default".
Note: The method also ignores EBADF error if the epoll file descriptor has been closed.
The behavior is as old as the implementation of select.epoll, bpo-1657:
Author: Christian Heimes <christian at cheimes.de>
Date: Fri Mar 21 23:49:44 2008 +0000
Applied patch #1657 epoll and kqueue wrappers for the select module
The patch adds wrappers for the Linux epoll syscalls and the BSD kqueue syscalls. Thanks to Thomas Herve and the Twisted people for their support a
TODO: Finish documentation documentation
Thomas Herve wrote a first implementation in bpo-1675118, but it seems like it was Christian Heimes who wrote the unregister() method.
components: Library (Lib)
nosy: christian.heimes, vstinner
title: select.epoll.unregister(fd) should not ignore EBADF
versions: Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce