[Python-checkins] cpython (3.2): Issue #8035: urllib: Fix a bug where the client could remain stuck after a

charles-francois.natali python-checkins at python.org
Sun Dec 18 16:10:11 CET 2011


http://hg.python.org/cpython/rev/a420b27a86d9
changeset:   74034:a420b27a86d9
branch:      3.2
parent:      74029:edc981ce8748
user:        Charles-François Natali <neologix at free.fr>
date:        Sun Dec 18 16:05:07 2011 +0100
summary:
  Issue #8035: urllib: Fix a bug where the client could remain stuck after a
redirection or an error.

files:
  Lib/urllib/request.py |  2 --
  Misc/NEWS             |  3 +++
  2 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1732,7 +1732,6 @@
 
     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 @@
             newurl = headers['uri']
         else:
             return
-        void = fp.read()
         fp.close()
 
         # In case the server sent a relative URL, join with original:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -97,6 +97,9 @@
 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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list