[issue20311] epoll.poll(timeout) must round the timeout to the upper bound
Charles-François Natali
report at bugs.python.org
Mon Jan 20 14:11:35 CET 2014
Charles-François Natali added the comment:
AFAICT, this also affects poll().
Although it's supposed to be passed an integer, passing a float will result
in a truncation towards 0:
"""
$ strace -e poll python -c "import select; p = select.poll(); p.poll(0.9)"
poll(0x23321b0, 0, 0) = 0 (Timeout)
"""
See also this line in PollSelector:
"""
def select(self, timeout=None):
timeout = None if timeout is None else max(int(1000 * timeout),
0)
"""
This will round timeout=1e-4 to 0.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20311>
_______________________________________
More information about the Python-bugs-list
mailing list