Commit 3c4dcea7 authored by Charles-François Natali's avatar Charles-François Natali

Issue #8035: urllib: Fix a bug where the client could remain stuck after a

redirection or an error.
parents 6099a032 cf53ae21
...@@ -1762,7 +1762,6 @@ class URLopener: ...@@ -1762,7 +1762,6 @@ class URLopener:
def http_error_default(self, url, fp, errcode, errmsg, headers): def http_error_default(self, url, fp, errcode, errmsg, headers):
"""Default error handler: close the connection and raise IOError.""" """Default error handler: close the connection and raise IOError."""
void = fp.read()
fp.close() fp.close()
raise HTTPError(url, errcode, errmsg, headers, None) raise HTTPError(url, errcode, errmsg, headers, None)
...@@ -1951,7 +1950,6 @@ class FancyURLopener(URLopener): ...@@ -1951,7 +1950,6 @@ class FancyURLopener(URLopener):
newurl = headers['uri'] newurl = headers['uri']
else: else:
return return
void = fp.read()
fp.close() fp.close()
# In case the server sent a relative URL, join with original: # In case the server sent a relative URL, join with original:
......
...@@ -419,6 +419,9 @@ Core and Builtins ...@@ -419,6 +419,9 @@ Core and Builtins
Library Library
------- -------
- Issue #8035: urllib: Fix a bug where the client could remain stuck after a
redirection or an error.
- Issue #13560: os.strerror() now uses the current locale encoding instead of - Issue #13560: os.strerror() now uses the current locale encoding instead of
UTF-8. UTF-8.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment