Patch #1627441: close sockets properly in urllib2.

This commit is contained in:
Georg Brandl 2007-01-21 10:35:10 +00:00
parent b84c13792d
commit dd7b0525e9
5 changed files with 63 additions and 6 deletions

View file

@ -1087,7 +1087,7 @@ class AbstractHTTPHandler(BaseHandler):
# out of socket._fileobject() and into a base class.
r.recv = r.read
fp = socket._fileobject(r)
fp = socket._fileobject(r, close=True)
resp = addinfourl(fp, r.msg, req.get_full_url())
resp.code = r.status