jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 86 forks source link

Module uses select, fails to work on boxes with lots of open files #65

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

Trying to start a connection always gives:

#!python
  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 278, in process_forever
    self.process_once(timeout)
  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 258, in process_once
    (i, o, e) = select.select(sockets, [], [], timeout)
ValueError: filedescriptor out of range in select()

Because the fileno generated by the socket can vary from 1250 to 6919. Module should use poll or epoll if available


jaraco commented 8 years ago

This all sounds reasonable, although I'm inclined to punt on this one and instead replace the event loop with an asyncio-backed implementation. That, of course, would require dropping support for Python 2, which may be unacceptable in the short term.

I'd be willing to accept a PR for supporting larger file descriptors. Would you be able to write a test to capture the failure and then fix it using poll or epoll as suggested? Any fix would need to remain compatible with systems not supplying poll or epoll.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

I'll accept a pull request to work around this limitation, but I won't be able to get around to working on it myself.