]> granicus.if.org Git - python/commitdiff
Issue #8035: urllib: Fix a bug where the client could remain stuck after a
authorCharles-François Natali <neologix@free.fr>
Sun, 18 Dec 2011 14:52:48 +0000 (15:52 +0100)
committerCharles-François Natali <neologix@free.fr>
Sun, 18 Dec 2011 14:52:48 +0000 (15:52 +0100)
redirection or an error.

Lib/urllib.py
Misc/NEWS

index 0432cccea6ca480223afd70cbc3cb50d617732d7..7b0a81cade78515f8efd149f266fd3a4e8cf717f 100644 (file)
@@ -374,7 +374,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 IOError, ('http error', errcode, errmsg, headers)
 
@@ -640,7 +639,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:
         newurl = basejoin(self.type + ":" + url, newurl)
index 8e7465c0a32186afc4e72eac0356d4cc69ddbcaa..455399cdc2842203a54121e0962120081bf2bc0f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -86,6 +86,9 @@ Core and Builtins
 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
   files, display a message popup and continue rather than crash.
   (original patch by Roger Serwy)