From 34d83db29c561732d1b5d567a600d1b2ac7b2b7d Mon Sep 17 00:00:00 2001 From: Mark Hetherington Date: Mon, 19 May 2014 14:48:12 +1000 Subject: [PATCH] When following redirections update url.extern --- linkcheck/checker/httpurl.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index e604f300..477ca8d7 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -247,6 +247,11 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport): self.aliases.append(newurl) # XXX on redirect errors this is not printed self.add_info(_("Redirected to `%(url)s'.") % {'url': newurl}) + + # Reset extern and recalculate + self.extern = None + self.set_extern(newurl) + self.urlparts = strformat.url_unicode_split(newurl) self.build_url_parts() self.url_connection = response