Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue11289

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:smtplib context manager
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.3
process
Status:closedResolution:accepted
Dependencies:Superseder:
Assigned To: barryNosy List: SilentGhost, barry, giampaolo.rodola, pitrou, python-dev
Priority:normalKeywords:patch

Created on2011-02-22 17:05 bygiampaolo.rodola, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
smtplib_context_manager.patchgiampaolo.rodola,2011-02-22 17:18
Messages (11)
msg129096 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2011-02-22 17:05
Patch in attachment provides a context manager for SMTP class so that it can be used with the "with" statement.
msg129099 -(view)Author: SilentGhost (SilentGhost)*(Python triager)Date: 2011-02-22 17:16
you didn't attach anything, Giampaolo.
msg129102 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2011-02-22 17:18
Ouch! Here. =)
msg129104 -(view)Author: SilentGhost (SilentGhost)*(Python triager)Date: 2011-02-22 17:24
is print really necessary in the test?Also, I think it would be better to unpack the tuple in test, rather then index it.
msg129105 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2011-02-22 17:26
> is print really necessary in the test?no, my mistake
msg130971 -(view)Author: SilentGhost (SilentGhost)*(Python triager)Date: 2011-03-15 13:32
A couple more minor issues:1. Double space required at the beginning of the "Here is a ..." sentence inDoc/library/smtplib.rst2. in __exit__ method: "msg" is the variable name assigned from docmd('QUIT') but "errmsg" is used when raising exception3. in test I'd rather prefer seeing stmp.noop() unpacked:    code, _ = smtp.noop()4. extra line #118 in test_smtplib5. is there any way to test SMTPResponseException?
msg131008 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2011-03-15 17:55
Thanks for the contribution!  It seems like a reasonable new feature, so I'll get this landed in 3.3.  Probably should use :versionadded: instead (thanks gps).  I'll address SilentGhost's issues in the commit.
msg131017 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2011-03-15 18:40
@barry I have commit privileges, but no problem if you want to commit it.
msg131019 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2011-03-15 18:50
On Mar 15, 2011, at 06:40 PM, Giampaolo Rodola' wrote:>>Giampaolo Rodola' <g.rodola@gmail.com> added the comment:>>@barry I have commit privileges, but no problem if you want to commit it.@giampaolo: I'd like to do it (and am almost ready to), mostly to test out hgworkflow, but also because I have some additions which address SilentGhost'scomments.  Thanks!  (Don't worry, you'll get credit in NEWS :).
msg131020 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2011-03-15 18:51
Go on, no prob.
msg131025 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2011-03-15 19:24
New changeseta6a94cfb75e9 by Barry Warsaw in branch 'default':- Issue#11289: `smtp.SMTP` class becomes a context manager so it can be usedhttp://hg.python.org/cpython/rev/a6a94cfb75e9
History
DateUserActionArgs
2022-04-11 14:57:13adminsetgithub: 55498
2011-03-15 19:28:10giampaolo.rodolasetnosy:barry,pitrou,giampaolo.rodola,SilentGhost,python-dev
type: enhancement
stage: resolved
2011-03-15 19:27:38barrysetnosy:barry,pitrou,giampaolo.rodola,SilentGhost,python-dev
resolution: accepted
2011-03-15 19:27:25barrysetstatus: open -> closed
nosy:barry,pitrou,giampaolo.rodola,SilentGhost,python-dev
2011-03-15 19:24:06python-devsetnosy: +python-dev
messages: +msg131025
2011-03-15 18:51:51giampaolo.rodolasetnosy:barry,pitrou,giampaolo.rodola,SilentGhost
messages: +msg131020
2011-03-15 18:50:28barrysetnosy:barry,pitrou,giampaolo.rodola,SilentGhost
messages: +msg131019
2011-03-15 18:40:27giampaolo.rodolasetnosy:barry,pitrou,giampaolo.rodola,SilentGhost
messages: +msg131017
2011-03-15 18:33:13SilentGhostlinkissue4972 dependencies
2011-03-15 17:55:35barrysetassignee:barry

messages: +msg131008
nosy: +barry
2011-03-15 13:32:31SilentGhostsetnosy:pitrou,giampaolo.rodola,SilentGhost
messages: +msg130971
2011-02-22 17:26:00giampaolo.rodolasetnosy:pitrou,giampaolo.rodola,SilentGhost
messages: +msg129105
2011-02-22 17:24:26SilentGhostsetnosy:pitrou,giampaolo.rodola,SilentGhost
messages: +msg129104
2011-02-22 17:18:35giampaolo.rodolasetfiles: +smtplib_context_manager.patch

messages: +msg129102
keywords: +patch
nosy:pitrou,giampaolo.rodola,SilentGhost
2011-02-22 17:16:17SilentGhostsetnosy: +SilentGhost
messages: +msg129099
components: + Library (Lib)
2011-02-22 17:05:04giampaolo.rodolacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp