The `unregister` in `remove` is being passed the wrong value.
cnobile2012 opened this issue · 0 comments
cnobile2012 commented
I've copied the method in the issue so it is obvious what I found. The call to the epoll().unregister() is being passed the source
not the file descriptor or in your case the fileno
integer value. This is most likely not blowing up because the source
is actually a long int (memory address) itself, but nothing is getting unregistered either. The Python docs indicate that both register
and unregister
should take as their 1st argument fd
(file descriptor).
def remove(self, source):
"""Removes an event source from the Selector.
Arguments:
source -- the event source to remove.
"""
fileno = source.fileno()
self._get_epoll().unregister(source)
del self._sources[fileno]