[issue12706] timeout sentinel in ftplib and poplib

New submission from Senthil Kumaran <senthil@uthcode.com>: - ftplib and poplib, has them as timeout=None, while they default to socket._GLOBAL_DEFAULT_TIMEOUT object. This is wrong; someone may pass None thinking it will trigger the default behaviour, and have nasty surprises. ---------- assignee: docs@python messages: 141740 nosy: docs@python, orsenthil priority: normal severity: normal stage: needs patch status: open title: timeout sentinel in ftplib and poplib type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12706> _______________________________________

Changes by Senthil Kumaran <senthil@uthcode.com>: ---------- title: timeout sentinel in ftplib and poplib -> timeout sentinel in ftplib and poplib documentation _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12706> _______________________________________

Changes by Terry J. Reedy <tjreedy@udel.edu>: ---------- components: +Documentation _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12706> _______________________________________

Greg added the comment: In the definition of FTP.connect(), I've changed the code to actually use None as a lack-of-explicit-timeout sentinel instead of -999. For FTP and FTP_TLS, I've changed the documentation to reflect what the code is doing. ---------- keywords: +patch nosy: +εσχατοκυριος Added file: http://bugs.python.org/file35524/patch.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12706> _______________________________________

Berker Peksag added the comment: Documentation changes look good to me. However, I'd prefer using socket._GLOBAL_DEFAULT_TIMEOUT in the timeout parameter of FTP.connect(). ---------- keywords: +easy nosy: +berker.peksag versions: +Python 3.5, Python 3.6, Python 3.7 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12706> _______________________________________

Marcel Widjaja <mwidj@yahoo.com> added the comment: Greg, I wonder if you are planning to submit a PR for your patch? If not, I'm plan to take your patch, make some minor adjustment and submit a PR. ---------- nosy: +mawidjaj _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue12706> _______________________________________

Greg <elorian.mestec@gmail.com> added the comment: Completely forgot about this, please take my patch and submit a pr On Fri, Dec 29, 2017 at 10:55 AM, Marcel Widjaja <report@bugs.python.org> wrote:
Marcel Widjaja <mwidj@yahoo.com> added the comment:
Greg, I wonder if you are planning to submit a PR for your patch? If not, I'm plan to take your patch, make some minor adjustment and submit a PR.
---------- nosy: +mawidjaj
_______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue12706> _______________________________________
---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue12706> _______________________________________

Change by Marcel Widjaja <mwidj@yahoo.com>: ---------- pull_requests: +5156 stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue12706> _______________________________________
participants (5)
-
Berker Peksag
-
Greg
-
Marcel Widjaja
-
Senthil Kumaran
-
Terry J. Reedy