]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport better fix for newurl as suggested by Jim Jewett in SF bug
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 5 May 2003 04:10:40 +0000 (04:10 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 5 May 2003 04:10:40 +0000 (04:10 +0000)
#730963.

Lib/urllib2.py

index e70b9e11e4e54b9c2e3a8bb66b150721f05a807f..1c33eb058e13aff6f3d256e24f40a85bb5c94aed 100644 (file)
@@ -406,7 +406,7 @@ class HTTPDefaultErrorHandler(BaseHandler):
         raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
 
 class HTTPRedirectHandler(BaseHandler):
-    def redirect_request(self, req, fp, code, msg, headers):
+    def redirect_request(self, req, fp, code, msg, headers, newurl):
         """Return a Request or None in response to a redirect.
 
         This is called by the http_error_30x methods when a redirection
@@ -442,7 +442,7 @@ class HTTPRedirectHandler(BaseHandler):
         # XXX Probably want to forget about the state of the current
         # request, although that might interact poorly with other
         # handlers that also use handler-specific request attributes
-        new = self.redirect_request(req, fp, code, msg, headers)
+        new = self.redirect_request(req, fp, code, msg, headers, newurl)
         if new is None:
             return