New submission from Claudiu.Popa: Hello!
I noticed that test_smtplib raises a ResourceWarning, tracking this to this piece of code: self.assertRaises(smtplib.SMTPResponseException, smtplib.SMTP, HOST, self.port, 'localhost', 3) What happens is that `SMTP.getreply` is called in `SMTP.__init__` after the socket was opened, but if getreply raises SMTPResponseException, the socket remains opened. The attached patch fixes this. ---------- components: Library (Lib) files: smtplib_resource_warning.patch keywords: patch messages: 219592 nosy: Claudiu.Popa priority: normal severity: normal status: open title: smtplib leaves open sockets around if SMTPResponseException is raised in __init__ type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file35459/smtplib_resource_warning.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21641> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com