]> git.ipfire.org Git - thirdparty/Python/cpython.git/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 15:05:07 +0000 (16:05 +0100)
committerCharles-François Natali <neologix@free.fr>
Sun, 18 Dec 2011 15:05:07 +0000 (16:05 +0100)
redirection or an error.

Lib/urllib/request.py
Misc/NEWS

index ca17da5b00fdc38524a574fa6719a02e278e5211..b41dd7eaa82fe56b2cbab6b70717029fbca630f0 100644 (file)
@@ -1732,7 +1732,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)
 
@@ -1923,7 +1922,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:
index 94af4462b9bc7589b52c29b0a7a582a538c574f2..72b33b99f3bd638a462fd9fa4c6f6d54ab6de3d6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -97,6 +97,9 @@ Core and Builtins
 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
   overwrite it.  Original patch by Hallvard B Furuseth.