Kaydet (Commit) f3d35f0e authored tarafından 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.
üst cc1a0865
...@@ -374,7 +374,6 @@ class URLopener: ...@@ -374,7 +374,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 IOError, ('http error', errcode, errmsg, headers) raise IOError, ('http error', errcode, errmsg, headers)
...@@ -640,7 +639,6 @@ class FancyURLopener(URLopener): ...@@ -640,7 +639,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:
newurl = basejoin(self.type + ":" + url, newurl) newurl = basejoin(self.type + ":" + url, newurl)
......
...@@ -86,6 +86,9 @@ Core and Builtins ...@@ -86,6 +86,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 #4625: If IDLE cannot write to its recent file or breakpoint - Issue #4625: If IDLE cannot write to its recent file or breakpoint
files, display a message popup and continue rather than crash. files, display a message popup and continue rather than crash.
(original patch by Roger Serwy) (original patch by Roger Serwy)
......
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