[issue12378] smtplib.SMTP_SSL leaks socket connections on SSL error

2011-06-20 Thread Joe Shaw
Joe Shaw added the comment: >From some experimentation, closing the underlying socket isn't enough. You >also need to close the SSL socket, so you'd need to do something like: new_socket = socket.create_connection((host, port), timeout) ssl_socket = ssl.wrap_socket(new_sock

[issue12378] smtplib.SMTP_SSL leaks socket connections on SSL error

2011-06-20 Thread Joe Shaw
New submission from Joe Shaw : Start a non-SSL server on port 2525: $ python -m smtpd -n -c DebuggingServer localhost:2525 In another terminal, fire up a python interpreter and run the following code: >>> import smtplib >>> s = smtplib.SMTP_SSL("localhost", 2525)