mirror of https://github.com/python/cpython.git
Issue #8035: urllib: Fix a bug where the client could remain stuck after a
redirection or an error.
This commit is contained in:
parent
a94a0e92b8
commit
cf53ae2171
|
@ -1732,7 +1732,6 @@ def http_error(self, url, fp, errcode, errmsg, headers, data=None):
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
@ -1923,7 +1922,6 @@ def redirect_internal(self, url, fp, errcode, errmsg, headers, data):
|
||||||
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:
|
||||||
|
|
|
@ -97,6 +97,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 #10350: Read and save errno before calling a function which might
|
- Issue #10350: Read and save errno before calling a function which might
|
||||||
overwrite it. Original patch by Hallvard B Furuseth.
|
overwrite it. Original patch by Hallvard B Furuseth.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue