From a29750c57f6213c39d01b11de9cbfae4cb3081b5 Mon Sep 17 00:00:00 2001 From: Nathan Arthur Date: Mon, 3 Oct 2022 19:33:05 +0100 Subject: [PATCH] Fix anchor comments in UrlBase Parent url query not stripped since: 4a0c63aa ("Fix joining of URLs when parent URL has CGI parameter.", 2011-02-08) --- linkcheck/checker/urlbase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index 9e9e16b9..d556b6db 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -458,7 +458,7 @@ class UrlBase: self.base_ref = urljoin(self.parent_url, self.base_ref) self.url = urljoin(self.base_ref, base_url) elif self.parent_url: - # strip the parent url query and anchor + # strip the parent url anchor urlparts = list(urllib.parse.urlsplit(self.parent_url)) urlparts[4] = "" parent_url = urlutil.urlunsplit(urlparts) @@ -512,7 +512,7 @@ class UrlBase: urlparts[1] = "%s@%s" % (self.userinfo, host) else: urlparts[1] = host - # safe anchor for later checking + # save anchor for later checking self.anchor = split.fragment if self.anchor is not None: assert isinstance(self.anchor, str), repr(self.anchor)