diff options
| author | Nadeem Vawda <nadeem.vawda@gmail.com> | 2011-07-23 13:51:16 (GMT) |
|---|---|---|
| committer | Nadeem Vawda <nadeem.vawda@gmail.com> | 2011-07-23 13:51:16 (GMT) |
| commit | b42c53e442b211d0ded1d4c9abd18c74d29ed663 (patch) | |
| tree | 0ad39ae840da96efaa2ff6bdb49f2c44a226c0aa /Lib/test/test_urllib2.py | |
| parent | 578617ad453c399ea52c0aef937fdf0904b2213c (diff) | |
| download | cpython-b42c53e442b211d0ded1d4c9abd18c74d29ed663.zip cpython-b42c53e442b211d0ded1d4c9abd18c74d29ed663.tar.gz cpython-b42c53e442b211d0ded1d4c9abd18c74d29ed663.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 e889bc3..e247315 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -611,6 +611,7 @@ class HandlerTests(unittest.TestCase): def retrfile(self, filename, filetype): self.filename, self.filetype = filename, filetype return StringIO.StringIO(self.data), len(self.data) + def close(self): pass class NullFTPHandler(urllib2.FTPHandler): def __init__(self, data): self.data = data |
