[issue17200] telnetlib.read_until() timeout uses the wrong units
Gregory P. Smith
report at bugs.python.org
Wed Dec 11 03:09:20 CET 2013
Gregory P. Smith added the comment:
Review comments added. I don't really see why the fix should not be as trivial as:
diff -r ca9bca7aecda Lib/telnetlib.py
--- a/Lib/telnetlib.py Tue Dec 10 16:06:46 2013 -0600
+++ b/Lib/telnetlib.py Tue Dec 10 18:08:37 2013 -0800
@@ -312,7 +312,9 @@
poller.register(self, poll_in_or_priority_flags)
while i < 0 and not self.eof:
try:
- ready = poller.poll(call_timeout)
+ # Poll takes its timeout in milliseconds.
+ ready = poller.poll(None if timeout is None
+ else 1000 * call_timeout)
except select.error as e:
if e.errno == errno.EINTR:
if timeout is not None:
@@ -682,7 +684,8 @@
poller.register(self, poll_in_or_priority_flags)
while not m and not self.eof:
try:
- ready = poller.poll(call_timeout)
+ ready = poller.poll(None if timeout is None
+ else 1000 * call_timeout)
except select.error as e:
if e.errno == errno.EINTR:
if timeout is not None:
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17200>
_______________________________________
More information about the Python-bugs-list
mailing list