diff options
author | Nadeem Vawda <nadeem.vawda@gmail.com> | 2011-07-23 12:03:00 (GMT) |
---|---|---|
committer | Nadeem Vawda <nadeem.vawda@gmail.com> | 2011-07-23 12:03:00 (GMT) |
commit | 08f5f7aa81321eb667609b2f096b2fc0c092cad4 (patch) | |
tree | 2c2b21982de26e2c715f4471ba11bf4edbd2dff2 /Lib/test/test_urllib2net.py | |
parent | de02a7194c50cc2244798e086d94fa0a4f33ab91 (diff) | |
download | cpython-08f5f7aa81321eb667609b2f096b2fc0c092cad4.zip cpython-08f5f7aa81321eb667609b2f096b2fc0c092cad4.tar.gz cpython-08f5f7aa81321eb667609b2f096b2fc0c092cad4.tar.bz2 |
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.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index eaad325..a475f56 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -222,6 +222,7 @@ class OtherNetworkTests(unittest.TestCase): handlers = [] cfh = urllib.request.CacheFTPHandler() + self.addCleanup(cfh.clear_cache) cfh.setTimeout(1) handlers.append(cfh) |