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.

classification
Title: telnetlib: time.monotonic() should be used instead of time.time() for timeout
Type: Stage:
Components: Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2013-10-21 20:01 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
telnetlib_monotonic.patch vstinner, 2013-10-21 21:16 review
Messages (6)
msg200834 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-21 20:01
While reading the patch attached to #19170, I saw that telnetlib uses time.time() to compute a timeout. This is wrong: the system clock may jump forward or backward (ex: summer/winter time, NTP adjust, manual clock change by the administrator, etc.).

time.monotonic() should be used instead. I will work on a patch when #19170 will be fixed (just to avoid conflicts).
msg200846 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-10-21 21:10
You can go ahead!
msg200848 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-21 21:16
Patch for telnetlib of Python 3.3.
msg201261 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-10-25 17:08
Victor, did you see Serhiy's comment?
msg201320 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-26 07:21
New changeset ea3deb022890 by Victor Stinner in branch '3.3':
Close #19339: telnetlib module is now using time.monotonic() when available to
http://hg.python.org/cpython/rev/ea3deb022890

New changeset d0f90d3f6203 by Victor Stinner in branch 'default':
(Merge 3.3) Close #19339: telnetlib module is now using time.monotonic() when
http://hg.python.org/cpython/rev/d0f90d3f6203
msg201321 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-26 07:21
> Victor, did you see Serhiy's comment?

Yes, I modified my patch to use _time name instead. The issue should now be fixed.
History
Date User Action Args
2022-04-11 14:57:52adminsetgithub: 63538
2013-10-26 07:21:58vstinnersetmessages: + msg201321
stage: resolved ->
2013-10-26 07:21:20python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg201320

resolution: fixed
stage: resolved
2013-10-25 17:08:49neologixsetmessages: + msg201261
2013-10-21 21:16:44vstinnersetfiles: + telnetlib_monotonic.patch
keywords: + patch
messages: + msg200848
2013-10-21 21:10:22neologixsetmessages: + msg200846
2013-10-21 20:01:15vstinnercreate