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.

Unsupported provider

classification
Title: nntplib.NNTP should support the context protocol
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: giampaolo.rodola Nosy List: giampaolo.rodola, pitrou
Priority: normal Keywords: patch

Created on 2010-09-07 22:42 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
nntplib-context-manager.patch giampaolo.rodola, 2011-02-25 20:34
Messages (6)
msg115815 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-07 22:42
As the title says. __exit__() simply has to call self.quit(), AFAICT.
msg115818 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-09-07 23:13
Assigning this to me.
Hopefully this should go into the plan of adding a context manager to all network libs (ftplib, smptlib, imaplib, etc..) in time for Python 3.2.
msg129420 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-02-25 20:34
Patch in attachment.
msg129510 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-26 08:14
Not sure that silencing errors from quit() is the right thing. Is there any reason?
msg129542 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-02-26 13:31
(socket.error, EOFError) after quit() indicates that the socket is disconnected, in which case we should not raise any error (or at least, this is the approach we're using in ftplib) while all other NNTPError related errors are not suppressed.
msg129993 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-03-03 18:34
Committed in r88734.
History
Date User Action Args
2022-04-11 14:57:06adminsetgithub: 54004
2011-03-03 18:34:25giampaolo.rodolasetstatus: open -> closed

messages: + msg129993
resolution: fixed
nosy: pitrou, giampaolo.rodola
2011-02-26 13:31:01giampaolo.rodolasetnosy: pitrou, giampaolo.rodola
messages: + msg129542
2011-02-26 08:14:39pitrousetnosy: pitrou, giampaolo.rodola
messages: + msg129510
2011-02-25 20:34:27giampaolo.rodolasetfiles: + nntplib-context-manager.patch
versions: + Python 3.3, - Python 3.2
nosy: pitrou, giampaolo.rodola
messages: + msg129420

keywords: + patch
2010-09-07 23:13:03giampaolo.rodolasetassignee: giampaolo.rodola
messages: + msg115818
2010-09-07 22:46:11pitrousetnosy: + giampaolo.rodola
2010-09-07 22:42:54pitroucreate