jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Interwiki: Ignore protocol ......................................................................
[FIX] Interwiki: Ignore protocol
Some interwikimaps use the HTTP protocol even though the family has stored it as HTTPS. This causes that an URL isn't detected as a valid URL even though it would work fine.
Change-Id: I62699eb1e41cb926fd66f8cd59e37927db9830cc --- M pywikibot/family.py 1 file changed, 7 insertions(+), 6 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py index bf04dbb..88d3da8 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -1064,9 +1064,9 @@ """ Return whether this family matches the given url.
- The protocol must match, if it is present in the URL. It must match - URLs generated via C{self.langs} and L{Family.nice_get_address} or - L{Family.path}. + It must match URLs generated via C{self.langs} and + L{Family.nice_get_address} or L{Family.path}. If the protocol doesn't + match but is present in the interwikimap it'll log this.
It uses L{Family._get_path_regex} to generate a regex defining the path after the domain. @@ -1085,9 +1085,10 @@ else: return None if url_match.group(1) and url_match.group(1) != self.protocol(code): - return None - else: - return code + pywikibot.log('The entry in the interwikimap uses {0} but the ' + 'family is configured to use {1}'.format( + url_match.group(1), self.protocol(code))) + return code
def maximum_GET_length(self, code): return config.maximum_GET_length
pywikibot-commits@lists.wikimedia.org