classification
Title: imaplib has no timeout setting
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Jairo Llopis, barry, corona10, eric.smith, maxking, r.david.murray, vstinner
Priority: normal Keywords: patch

Created on 2019-10-28 13:58 by Jairo Llopis, last changed 2020-01-07 17:28 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17203 merged corona10, 2019-11-17 08:47
Messages (5)
msg355542 - (view) Author: Jairo Llopis (Jairo Llopis) Date: 2019-10-28 13:58
No way to pass a timeout to imaplib.IMAP4 or imaplib.IMAP4_SSL.

When opening the connection, the only way is to use socket.settimeout(), which affects the global execution environment.

It's interesting that poplib includes the needed timeout parameter instead... weird. I think it was forgotten for imaplib.
msg355584 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-10-28 18:30
I think this is a reasonable request. It would have to be a 3.9 feature.

Perhaps some code (and tests) can be stolen from poplib.
msg356795 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2019-11-17 09:00
@eric.smith

I 've submitted the patch, Can I get a review from you if you don't mind?
Thank you :)
msg359523 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-01-07 17:28
New changeset 13a7ee8d62dafe7d2291708312fa2a86e171c7fa by Victor Stinner (Dong-hee Na) in branch 'master':
bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203)
https://github.com/python/cpython/commit/13a7ee8d62dafe7d2291708312fa2a86e171c7fa
msg359524 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-01-07 17:28
Thanks Jairo Llopis for the feature request and thanks Dong-hee Na for actually implementing it!
History
Date User Action Args
2020-01-07 17:28:49vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg359524

stage: patch review -> resolved
2020-01-07 17:28:16vstinnersetnosy: + vstinner
messages: + msg359523
2019-11-17 09:00:36corona10setnosy: + corona10
messages: + msg356795
2019-11-17 08:47:25corona10setpull_requests: - pull_request16707
2019-11-17 08:47:04corona10setpull_requests: + pull_request16709
2019-11-17 08:44:03corona10setkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request16707
2019-10-28 18:30:27eric.smithsetversions: - Python 3.5, Python 3.6, Python 3.7, Python 3.8
nosy: + eric.smith

messages: + msg355584

stage: needs patch
2019-10-28 14:38:55xtreaksetnosy: + barry, r.david.murray, maxking
2019-10-28 13:58:01Jairo Llopiscreate