summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-12-18 15:05:07 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-12-18 15:05:07 (GMT)
commitcf53ae2171d01eed0e1c902b51da27b5bdfbc143 (patch)
tree73ba45f809af8a58746ed7c994ebf31178bf4bbc
parenta94a0e92b8c1f75c2a89ce78a26bc57ef9414c3c (diff)
downloadcpython-cf53ae2171d01eed0e1c902b51da27b5bdfbc143.zip
cpython-cf53ae2171d01eed0e1c902b51da27b5bdfbc143.tar.gz
cpython-cf53ae2171d01eed0e1c902b51da27b5bdfbc143.tar.bz2
Issue #8035: urllib: Fix a bug where the client could remain stuck after a
redirection or an error.
-rw-r--r--Lib/urllib/request.py2
-rw-r--r--Misc/NEWS3
2 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index ca17da5..b41dd7e 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -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:
diff --git a/Misc/NEWS b/Misc/NEWS
index 94af446..72b33b9 100644
--- 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.