Skip to content

The unregister in remove is being passed the wrong value. #53

@cnobile2012

Description

@cnobile2012

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions