]> granicus.if.org Git - python/commitdiff
Merge: #5713: Handle 421 error codes during sendmail by closing the socket.
authorR David Murray <rdmurray@bitdance.com>
Thu, 21 Mar 2013 01:13:56 +0000 (21:13 -0400)
committerR David Murray <rdmurray@bitdance.com>
Thu, 21 Mar 2013 01:13:56 +0000 (21:13 -0400)
This is a partial fix to the issue of servers disconnecting unexpectedly; in
this case the 421 says they are disconnecting, so we close the socket and
return the 421 in the appropriate error context.

Original patch by Mark Sapiro, updated by Kushal Das, with additional
tests by me.

1  2 
Lib/smtplib.py
Lib/test/test_smtplib.py
Misc/NEWS

diff --cc Lib/smtplib.py
Simple merge
Simple merge
diff --cc Misc/NEWS
index 6f2011a0cc46404fd91f688c0c11b62f5bea3e80,fe5afdd590038b72daefc9daa73a28764383c9c9..ba34efee6ee44f311fa8b29cef708361ea70c72e
+++ b/Misc/NEWS
@@@ -292,18 -196,10 +292,22 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #5713: smtplib now handles 421 (closing connection) error codes when
+   sending mail by closing the socket and reporting the 421 error code via the
+   exception appropriate to the command that received the error response.
 +- Issue #16997: unittest.TestCase now provides a subTest() context manager
 +  to procedurally generate, in an easy way, small test instances.
 +
 +- Issue #17485: Also delete the Request Content-Length header if the data
 +  attribute is deleted.  (Follow on to issue 16464).
 +
 +- Issue #15927: CVS now correctly parses escaped newlines and carriage
 +  when parsing with quoting turned off.
 +
 +- Issue #17467: add readline and readlines support to mock_open in
 +  unittest.mock.
 +
  - Issue #17192: Update the ctypes module's libffi to v3.0.13.  This
    specifically addresses a stack misalignment issue on x86 and issues on
    some more recent platforms.