]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
#17498: Defer SMTPServerDisconnected errors until the next command.
authorR David Murray <rdmurray@bitdance.com>
Mon, 14 Apr 2014 22:21:38 +0000 (18:21 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 14 Apr 2014 22:21:38 +0000 (18:21 -0400)
commitafb151a5cc6fb1012d4b2827d2fdcbf98c07206d
treeab03e825771e5a38d34ce218cfa26a26fd0b90b7
parent4a24d09d623f66368bb3ab12dd8f1fed589cece4
#17498: Defer SMTPServerDisconnected errors until the next command.

Normally an SMTP server will return an error, and smtplib will then issue an
RSET to return the connection to the known starting state.  Some servers,
however, disconnect after issuing certain errors.  When we issue the RSET,
this would result in raising an SMTPServerDisconnected error, *instead* of
returning the error code the user of the library was expecting.  This fix
makes the internal RSET calls ignore the disconnection so that the error code
is returned.  The user of the library will then get the SMTPServerDisconnected
error the next time they try to talk to the server.

Patch by Kushal Das.
Lib/smtplib.py
Lib/test/test_smtplib.py
Misc/NEWS