jenkins-bot has submitted this change and it was merged.
Change subject: Fix Site loading without an explicit family ......................................................................
Fix Site loading without an explicit family
Change-Id: Ia6696de8f7718e1e48b6186035349c786459495b --- M pywikibot/textlib.py M scripts/interwiki.py 2 files changed, 12 insertions(+), 7 deletions(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve Ricordisamoa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 530dc70..f7a8da6 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -624,11 +624,15 @@ def interwikiFormat(links, insite=None): """Convert interwiki link dict into a wikitext string.
- 'links' should be a dict with the Site objects as keys, and Page - or Link objects as values. - - Return a unicode string that is formatted for inclusion in insite - (defaulting to the current site). + @param links: interwiki links to be formatted + @type links: dict with the Site objects as keys, and Page + or Link objects as values. + @param insite: site the interwiki links will be formatted for + (defaulting to the current site). + @type insite: BaseSite + @return: string including wiki links formatted for inclusion + in insite + @rtype: unicode """ if insite is None: insite = pywikibot.Site() @@ -644,7 +648,8 @@ link = title.replace('[[:', '[[') s.append(link) except AttributeError: - s.append(pywikibot.Site(code=site).linkto(links[site], othersite=insite)) + s.append(pywikibot.Site(site, insite.family).linkto( + links[site], othersite=insite)) if insite.lang in insite.family.interwiki_on_one_line: sep = u' ' else: diff --git a/scripts/interwiki.py b/scripts/interwiki.py index 396a085..cafbbbc 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -1680,7 +1680,7 @@ frgnSiteDone = False
for siteCode in lclSite.family.languages_by_size: - site = pywikibot.Site(siteCode) + site = pywikibot.Site(siteCode, lclSite.family) if (not lclSiteDone and site == lclSite) or \ (not frgnSiteDone and site != lclSite and site in new): if site == lclSite:
pywikibot-commits@lists.wikimedia.org