summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-07-23 12:25:45 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-07-23 12:25:45 (GMT)
commit0200016132255124e22d9b48d0e6444ec62fecdd (patch)
tree2dd408820ae46c61c1ae9e328faddd3358b61891 /Lib/test/test_urllib2.py
parent7cd94a1e232b3af6ab6df363336907fc4bce53f6 (diff)
parent08f5f7aa81321eb667609b2f096b2fc0c092cad4 (diff)
downloadcpython-0200016132255124e22d9b48d0e6444ec62fecdd.zip
cpython-0200016132255124e22d9b48d0e6444ec62fecdd.tar.gz
cpython-0200016132255124e22d9b48d0e6444ec62fecdd.tar.bz2
Merge: #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.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index d19e116..713a97f 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -623,6 +623,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