msg129096 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
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) *  |
Date: 2011-02-22 17:16 |
you didn't attach anything, Giampaolo. |
|
|
msg129102 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2011-02-22 17:18 |
Ouch! Here. =) |
|
|
msg129104 - (view) |
Author: SilentGhost (SilentGhost) *  |
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) *  |
Date: 2011-02-22 17:26 |
> is print really necessary in the test? no, my mistake |
|
|
msg130971 - (view) |
Author: SilentGhost (SilentGhost) *  |
Date: 2011-03-15 13:32 |
A couple more minor issues: 1. Double space required at the beginning of the "Here is a ..." sentence in Doc/library/smtplib.rst 2. in __exit__ method: "msg" is the variable name assigned from docmd('QUIT') but "errmsg" is used when raising exception 3. in test I'd rather prefer seeing stmp.noop() unpacked: code, _ = smtp.noop() 4. extra line #118 in test_smtplib 5. is there any way to test SMTPResponseException? |
|
|
msg131008 - (view) |
Author: Barry A. Warsaw (barry) *  |
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) *  |
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) *  |
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 hg workflow, but also because I have some additions which address SilentGhost's comments. Thanks! (Don't worry, you'll get credit in NEWS :). |
|
|
msg131020 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2011-03-15 18:51 |
Go on, no prob. |
|
|
msg131025 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2011-03-15 19:24 |
New changeset a6a94cfb75e9 by Barry Warsaw in branch 'default': - Issue #11289: `smtp.SMTP` class becomes a context manager so it can be used http://hg.python.org/cpython/rev/a6a94cfb75e9 |
|
|