jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] cosmetic_changes: Allow missing HTTPS hostname ......................................................................
[FIX] cosmetic_changes: Allow missing HTTPS hostname
If there is not HTTPS hostname it can't compare that hostname with the HTTP hostname so it should skip it. The loop below creating a list for each separate protocol is already supporting the HTTPS hostname to be `None`.
Bug: T116585 Change-Id: If37f1ec9fcdf653ef3f4dfa2712da2f55846227f --- M pywikibot/cosmetic_changes.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py index c27f9bc..8aabc09 100755 --- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -712,7 +712,7 @@ https_url = self.site.base_url(suffix, 'https') # compare strings without the protocol, if they are empty support # also no prefix (//en.wikipedia.org/…) - if http_url[4:] == https_url[5:]: + if https_url is not None and http_url[4:] == https_url[5:]: urls = ['(?:https?:)?' + re.escape(http_url[5:])] else: urls = [re.escape(url) for url in (http_url, https_url)
pywikibot-commits@lists.wikimedia.org