XZise has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248875

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/75/248875/1

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)

-- 
To view, visit https://gerrit.wikimedia.org/r/248875
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If37f1ec9fcdf653ef3f4dfa2712da2f55846227f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <commodorefabia...@gmx.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to