This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author njs
Recipients njs
Date 2017-01-12.23:42:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484264538.85.0.902649207203.issue29256@psf.upfronthosting.co.za>
In-reply-to
Content
If SelectSelector.select() is called when there are no fds registered, then it ends up calling select.select([], [], [], timeout).

On sensible operating systems, this is equivalent to time.sleep(timeout). On Windows, it raises an error. Asyncio manages to avoid hitting this due to the fact that it always has at least one fd registered, but it causes problems for other users of the selectors module, e.g.:
  https://github.com/dabeaz/curio/issues/75

I see two possible approaches to fixing this:

1) Modify SelectSelector to check for this case and call time.sleep() instead of select.select() when encountered.

2) Modify the select.select() wrapper so that it behaves consistently on all operating systems, by special-casing this situation on Windows.

Option (2) seems nicer to me.
History
Date User Action Args
2017-01-12 23:42:18njssetrecipients: + njs
2017-01-12 23:42:18njssetmessageid: <1484264538.85.0.902649207203.issue29256@psf.upfronthosting.co.za>
2017-01-12 23:42:18njslinkissue29256 messages
2017-01-12 23:42:18njscreate