From cf53ae2171d01eed0e1c902b51da27b5bdfbc143 Mon Sep 17 00:00:00 2001 From: Charles-François Natali Date: Sun, 18 Dec 2011 16:05:07 +0100 Subject: Issue #8035: urllib: Fix a bug where the client could remain stuck after a redirection or an error. --- Lib/urllib/request.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'Lib/urllib/request.py') diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index ca17da5b00f..b41dd7eaa82 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: -- cgit v1.2.3