[issue17200] telnetlib.read_until() timeout uses the wrong units
Gregory P. Smith added the comment: anyways, i went with just the simple fix and no specific test for this issue as the tests were painful and questionable reliability. i appreciate the other refactoring suggestion within the code but for 2.7 and 3.3 bugfixes where no significant changes are ever likely within telnetlib.py they didn't seem warranted. 3.4's code is cleaner thanks to the new selector stuff. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
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 rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Changes by Gregory P. Smith g...@krypto.org: -- assignee: - gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Roundup Robot added the comment: New changeset d61e8050b7d7 by Gregory P. Smith in branch '2.7': Fixes Issue #17200: telnetlib's read_until and expect timeout was broken by the http://hg.python.org/cpython/rev/d61e8050b7d7 New changeset 46186736e91c by Gregory P. Smith in branch '3.3': Fixes Issue #17200: telnetlib's read_until and expect timeout was broken by the http://hg.python.org/cpython/rev/46186736e91c -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Serhiy Storchaka added the comment: Review comments added. Only original author can answer your questions. I don't really see why the fix should not be as trivial as: Yes, these are simple and obvious, and only changes which I understand. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +neologix versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Serhiy Storchaka added the comment: The patch is not compatible with 3.4. Does this bug exist in 3.4? -- stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Charles-François Natali added the comment: The patch is not compatible with 3.4. Does this bug exist in 3.4? No, selectors all expect a timeout in seconds, so this should be fixed in 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Serhiy Storchaka added the comment: Last patch is corrupted and outdated. Here is updated and fixed version. I have not examined it closely. -- Added file: http://bugs.python.org/file33065/issue17200.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Serhiy Storchaka added the comment: 0 and None must be different. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Reuben D'Netto added the comment: OK, I've implemented tests for read_until() and expect() using both poll and select. I ended up rewriting _read_until_with_select() to look more like the poll equivalent in the process, which should hopefully make it more maintainable. -- Added file: http://bugs.python.org/file29076/telnetlib.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Reuben D'Netto added the comment: Sure, no problem. I'll upload the completed patch once I've got it working. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
New submission from Reuben D'Netto: read_until() takes a value for timeout in seconds, but passes it to poll(), which takes a value in milliseconds. -- files: telnetlib.py.patch keywords: patch messages: 181993 nosy: Reuben.D'Netto priority: normal severity: normal status: open title: telnetlib.read_until() timeout uses the wrong units type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file29055/telnetlib.py.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Reuben D'Netto added the comment: Updated patch to fix expect() as well. -- Added file: http://bugs.python.org/file29056/telnetlib.py.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Senthil Kumaran added the comment: Thanks for the bug report, Reuben. I verified that this is indeed a bug and should be fixed in all versions. Thanks for the patch too, would you like to enhance it with tests? GeneralTests in test_telnetlib.py support timeout and you could that exercise timeout value in secs. -- nosy: +orsenthil stage: - test needed versions: +Python 2.7, Python 3.2, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Gregory P. Smith added the comment: this bug was likely introduced when i applied the telnetlib patches to use poll to not hit the select fd limit. doh. nice catch! -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17200] telnetlib.read_until() timeout uses the wrong units
Senthil Kumaran added the comment: @gps: looks like it is. For changeset: 78129:de229dde486b for Issue #14635 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17200 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com