jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/538384 )
Change subject: [bugfix] enable creating sites from url for closed wikis ......................................................................
[bugfix] enable creating sites from url for closed wikis
import pwb, pywikibot as py s = py.Site(url='https://hz.wikipedia.org/wiki/$1') s
ClosedSite("hz", "wikipedia")
Bug: T233487 Change-Id: Ia8846d152ab7349a8f84913af03f84908de13b42 --- M pywikibot/family.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py index 2333640..f12ef93 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -1309,7 +1309,10 @@ return None
matched_sites = [] - for code in chain(self.codes, getattr(self, 'test_codes', ())): + for code in chain(self.codes, + getattr(self, 'test_codes', ()), + getattr(self, 'closed_wikis', ()), + ): if self._hostname(code)[1] == parsed.netloc: # Use the code and family instead of the url # This is only creating a Site instance if domain matches
pywikibot-commits@lists.wikimedia.org