mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Patch #1627441: close sockets properly in urllib2.
This commit is contained in:
parent
b84c13792d
commit
dd7b0525e9
5 changed files with 63 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue