mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #8035: urllib: Fix a bug where the client could remain stuck after a
redirection or an error.
This commit is contained in:
commit
3c4dcea712
2 changed files with 3 additions and 2 deletions
|
@ -1762,7 +1762,6 @@ class URLopener:
|
|||
|
||||
def http_error_default(self, url, fp, errcode, errmsg, headers):
|
||||
"""Default error handler: close the connection and raise IOError."""
|
||||
void = fp.read()
|
||||
fp.close()
|
||||
raise HTTPError(url, errcode, errmsg, headers, None)
|
||||
|
||||
|
@ -1951,7 +1950,6 @@ class FancyURLopener(URLopener):
|
|||
newurl = headers['uri']
|
||||
else:
|
||||
return
|
||||
void = fp.read()
|
||||
fp.close()
|
||||
|
||||
# In case the server sent a relative URL, join with original:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue