diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2014-06-03 14:25:40 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2014-06-03 14:25:40 (GMT) |
commit | f6f61ff339c80dd164668c9689e0b56c5dfc5417 (patch) | |
tree | be100ba1aa1810f0b72867e0cdf444ddd69e6d6e /Lib | |
parent | 6120ab8150bec7131f8bb2713f3bcba8adad01e5 (diff) | |
parent | 4ce118e99a21639ceed744ced7d35d8f0ec5f0c2 (diff) | |
download | cpython-f6f61ff339c80dd164668c9689e0b56c5dfc5417.zip cpython-f6f61ff339c80dd164668c9689e0b56c5dfc5417.tar.gz cpython-f6f61ff339c80dd164668c9689e0b56c5dfc5417.tar.bz2 |
merge from 3.4
Fix issue #21641: Close the socket before raising the SMTPResponseException. Fixes the ResourceWarning in the test run.
Patch by Claudiu.Popa.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/smtplib.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index ec43666..759b77e 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -377,6 +377,7 @@ class SMTP: if self.debuglevel > 0: print('reply:', repr(line), file=stderr) if len(line) > _MAXLINE: + self.close() raise SMTPResponseException(500, "Line too long.") resp.append(line[4:].strip(b' \t\r\n')) code = line[:3] |