8000 Fixes Issue #17200: telnetlib's read_until and expect timeout was bro… · python/cpython@acd1730 · GitHub
[go: up one dir, main page]

Skip to content

Commit acd1730

Browse files
committed
Fixes Issue #17200: telnetlib's read_until and expect timeout was broken by the
fix to Issue #14635 in Python 3.3.0 to be interpreted as milliseconds instead of seconds when the platform supports select.poll (ie: everywhere). It is now treated as seconds once again.
1 parent f3c6589 commit acd1730

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Lib/telnetlib.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ def _read_until_with_poll(self, match, timeout):
315315
poller.register(self, poll_in_or_priority_flags)
316316
while i < 0 and not self.eof:
317317
try:
318-
ready = poller.poll(call_timeout)
318+
ready = poller.poll(None if timeout is None
319+
else 1000 * call_timeout)
319320
except select.error as e:
320321
if e.errno == errno.EINTR:
321322
if timeout is not None:
@@ -683,7 +684,8 @@ def _expect_with_poll(self, expect_list, timeout=None):
683684
poller.register(self, poll_in_or_priority_flags)
684685
while not m and not self.eof:
685686
try:
686-
ready = poller.poll(call_timeout)
687+
ready = poller.poll(None if timeout is None
688+
else 1000 * call_timeout)
687689
except select.error as e:
688690
if e.errno == errno.EINTR:
689691
if timeout is not None:

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Core and Builtins
2020
Library
2121
-------
2222

23+
- Issue #17200: telnetlib's read_until and expect timeout was broken by the
24+
fix to Issue #14635 in Python 3.3.0 to be interpreted as milliseconds
25+
instead of seconds when the platform supports select.poll (ie: everywhere).
26+
It is now treated as seconds once again.
27+
2328
- Issue #17429: platform.linux_distribution() now decodes files from the UTF-8
2429
encoding with the surrogateescape error handler, instead of decoding from the
2530
locale encoding in strict mode. It fixes the function on Fedora 19 which is

0 commit comments

Comments
 (0)
0