jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1268224?usp=email )
Change subject: Site(): redirect explicit abstract wikipedia to abstract family
......................................................................
Site(): redirect explicit abstract wikipedia to abstract family
If code, fam is given as 'abstract', 'wikipedia', redirect is to
abstract family. This is necessary for example for language links
given by APISite.pagelanglinks
Bug: T422369
Change-Id: I9109b1f54734f71d64c4b729637da067563afe08
---
M pywikibot/__init__.py
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
jenkins-bot: Verified
Jforrester: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 09f35cc..0064d40 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -193,6 +193,9 @@
any longer.
.. version-changed:: 10.3
accept a trailing slash in *url* after domain.
+ .. version-changed:: 11.2
+ Redirect abstract wikipedia to :mod:`abstract family
+ <families.abstract_family>`
:param code: Site code (override config.mylang); *code* may also be
a sitename like 'wikipedia:test'
@@ -225,6 +228,11 @@
if not fam: # try code as family
with suppress(exceptions.UnknownFamilyError):
fam = Family.load(code)
+
+ # ensure that abstract family is used
+ if (code, fam) == ('abstract', 'wikipedia'):
+ fam = 'abstract'
+
# Fallback to config defaults
code = code or _config.mylang
fam = fam or _config.family
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1268224?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I9109b1f54734f71d64c4b729637da067563afe08
Gerrit-Change-Number: 1268224
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]