summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket_ssl.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-07-27 18:28:22 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-07-27 18:28:22 (GMT)
commitf25e35b9ec2bb87833108c5bb615113a93894dce (patch)
tree762243a7b55d327261b43be53d7d9981de8687c0 /Lib/test/test_socket_ssl.py
parentec2ce9bbaeb9d21fe0390fea7dca8e04be526a23 (diff)
downloadcpython-f25e35b9ec2bb87833108c5bb615113a93894dce.zip
cpython-f25e35b9ec2bb87833108c5bb615113a93894dce.tar.gz
cpython-f25e35b9ec2bb87833108c5bb615113a93894dce.tar.bz2
Bug #978833: Close https sockets by releasing the _ssl object.
Diffstat (limited to 'Lib/test/test_socket_ssl.py')
-rw-r--r--Lib/test/test_socket_ssl.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_socket_ssl.py b/Lib/test/test_socket_ssl.py
index dffa2c5..e08ec44 100644
--- a/Lib/test/test_socket_ssl.py
+++ b/Lib/test/test_socket_ssl.py
@@ -106,6 +106,25 @@ class BasicTests(unittest.TestCase):
connector()
t.join()
+ def test_978833(self):
+ if test_support.verbose:
+ print "test_978833 ..."
+
+ import os, httplib
+ with test_support.transient_internet():
+ s = socket.socket(socket.AF_INET)
+ s.connect(("www.sf.net", 443))
+ fd = s._sock.fileno()
+ sock = httplib.FakeSocket(s, socket.ssl(s))
+ s = None
+ sock.close()
+ try:
+ os.fstat(fd)
+ except OSError:
+ pass
+ else:
+ raise test_support.TestFailed("Failed to close socket")
+
class OpenSSLTests(unittest.TestCase):
def testBasic(self):