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 neologix
Recipients christian.heimes, felipecruz, giampaolo.rodola, gvanrossum, meador.inge, neologix, pitrou, rosslagerwall, sbt
Date 2013-08-02.17:59:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
> Thanks!  We should make sure this makes it into alpha 2.  Could you also
> prepare a patch for Tulip itself?  That way I can make sure Tulip works with
> either its own or the stdlib implementation.

Sure, here's a patch (tulip_selector_stdlib.diff).

It seems to work fine, but I'm getting random errors even with vanilla tulip:
FAIL: test_run_until_complete_timeout (events_test.EPollEventLoopTests)
Traceback (most recent call last):
  File "tests/", line 194, in test_run_until_complete_timeout
    self.assertTrue(0.009 <= t2-t1 <= 0.018, t2-t1)
AssertionError: False is not true : 0.0055361779959639534

Looks like the timeouts check may be a bit too tight?

I'm also updating the patch a bit:
- when a timeout < 0 is passed to select(), it's treated as timeout ==
0, i.e. polling. It fixes a common kind of nasty bugs in user code
where when calculating timeouts, if you end up passing a negative
value, it can either be interpreted as an infinite wait, or can raise
- previously, upon EINTR (InterruptedError), select() would return an
empty list. That can be a problem if the user specified a timeout,
because you end up returning too early. Thanks to a decorator,
select() now retries upon EINTR, re-calculating the timeout. I also
added a test for this.

I'm pretty happy with the state now, so I think it's ready for review.
There are a couple points I'd like more specific feedback:
- is the registered_count() method still useful, now that get_keys()
can return all the keys?
- same thing for get_info(), it feels redundant
- the documentation ;-)
File name Uploaded
selector-11.diff neologix, 2013-08-02.17:59:44
tulip_selector_stdlib.diff neologix, 2013-08-02.17:59:45
Date User Action Args
2013-08-02 17:59:50neologixsetrecipients: + neologix, gvanrossum, pitrou, giampaolo.rodola, christian.heimes, meador.inge, rosslagerwall, sbt, felipecruz
2013-08-02 17:59:46neologixlinkissue16853 messages
2013-08-02 17:59:46neologixcreate