summaryrefslogtreecommitdiff
path: root/Lib/test/test_urllib2net.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-07-23 15:51:16 +0200
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-07-23 15:51:16 +0200
commitb42c53e442b211d0ded1d4c9abd18c74d29ed663 (patch)
tree0ad39ae840da96efaa2ff6bdb49f2c44a226c0aa /Lib/test/test_urllib2net.py
parent578617ad453c399ea52c0aef937fdf0904b2213c (diff)
downloadcpython-git-b42c53e442b211d0ded1d4c9abd18c74d29ed663.tar.gz
Issue #10883: Fix socket leaks in urllib.request.
* ftpwrapper now uses reference counting to ensure that the underlying socket is closed when the ftpwrapper object is no longer in use * ftplib.FTP.ntransfercmd() now closes the socket if an error occurs Initial patch by Victor Stinner.
Diffstat (limited to 'Lib/test/test_urllib2net.py')
-rw-r--r--Lib/test/test_urllib2net.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index 867fcfa41e..5ffba87fdf 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -231,6 +231,7 @@ class OtherNetworkTests(unittest.TestCase):
handlers = []
cfh = urllib2.CacheFTPHandler()
+ self.addCleanup(cfh.clear_cache)
cfh.setTimeout(1)
handlers.append(cfh)