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

Created on 2013-10-21 20:01 by haypo, last changed 2013-10-26 07:21 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
telnetlib_monotonic.patch haypo, 2013-10-21 21:16 review
Messages (6)
msg200834 - (view) Author: STINNER Victor (haypo) * (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 (haypo) * (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) 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 (haypo) * (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
2013-10-26 07:21:58hayposetmessages: + 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:44hayposetfiles: + telnetlib_monotonic.patch
keywords: + patch
messages: + msg200848
2013-10-21 21:10:22neologixsetmessages: + msg200846
2013-10-21 20:01:15haypocreate