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_urllib2.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_urllib2.py')
-rw-r--r-- | Lib/test/test_urllib2.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 58ef836..03cd927 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -622,6 +622,7 @@ class HandlerTests(unittest.TestCase): def retrfile(self, filename, filetype): self.filename, self.filetype = filename, filetype return io.StringIO(self.data), len(self.data) + def close(self): pass class NullFTPHandler(urllib.request.FTPHandler): def __init__(self, data): self.data = data |