This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Péter.Szabó
Recipients Péter.Szabó
Date 2010-02-14.11:24:24
SpamBayes Score 0.002333327
Marked as misclassified No
Message-id <1266146726.16.0.222413736354.issue7927@psf.upfronthosting.co.za>
In-reply-to
Content
Here is how to reproduce:

import socket
import ssl
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sslsock = ssl.SSLSocket(sock)
assert sslsock._sslobj is None
sslsock.connect(('www.gmail.com', 443))
assert isinstance(sslsock._sslobj, socket._ssl.SSLType)
assert 0 == sslsock._makefile_refs
sslsock.makefile().close()
assert 1 == sslsock._makefile_refs  # Should be 0.
assert sslsock._sslobj is not None  # Should be None.

I think the problem is in SSLSocket.makefile, which initializes the _fileobject with close=False by default.
History
Date User Action Args
2010-02-14 11:25:26Péter.Szabósetrecipients: + Péter.Szabó
2010-02-14 11:25:26Péter.Szabósetmessageid: <1266146726.16.0.222413736354.issue7927@psf.upfronthosting.co.za>
2010-02-14 11:24:25Péter.Szabólinkissue7927 messages
2010-02-14 11:24:24Péter.Szabócreate