jenkins-bot has submitted this change and it was merged.
Change subject: Pass site around ......................................................................
Pass site around
Several methods in textlib received a Site object, but didnt pass it to other methods.
Bugs identified by running textlib tests using a dry site.
Change-Id: I364886afcf0e7a7caf0d3f548a35b53fde0b216a --- M pywikibot/textlib.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 9cbf0d7..4c74cef 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -491,7 +491,8 @@ % languages, re.IGNORECASE) text = replaceExcept(text, interwikiR, '', ['nowiki', 'comment', 'math', 'pre', 'source'], - marker=marker) + marker=marker, + site=site) return text.strip()
@@ -713,7 +714,8 @@ categoryR = re.compile(r'[[\s*(%s)\s*:.*?]]\s*' % catNamespace, re.I) text = replaceExcept(text, categoryR, '', ['nowiki', 'comment', 'math', 'pre', 'source'], - marker=marker) + marker=marker, + site=site) if marker: # avoid having multiple linefeeds at the end of the text text = re.sub('\s*%s' % re.escape(marker), config.LS + marker, @@ -837,7 +839,7 @@ elif site.language() in site.family.categories_last: newtext = s2.replace(marker, '').strip() + separator + s else: - interwiki = getLanguageLinks(s2) + interwiki = getLanguageLinks(s2, insite=site) s2 = removeLanguageLinksAndSeparator(s2.replace(marker, ''), site, '', iseparatorstripped