jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[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(-)

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

To view, visit change 538384. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8846d152ab7349a8f84913af03f84908de13b42
Gerrit-Change-Number: 538384
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)