jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/487067 )
Change subject: [bugfix] Fix for loop in copyAndKeep() ......................................................................
[bugfix] Fix for loop in copyAndKeep()
As pointed out in https://gerrit.wikimedia.org/r/#/c/pywikibot/core/+/487054/, the for loop is broken here since https://phabricator.wikimedia.org/rPWBO53135d55c341278bb6844183701bc78afe121... in compat was merged. In compat this bug was fixed in 2008, but I suspect the copyAndKeep method isn't used in core anymore as this bug never showed up.
Change-Id: I589c17af428c48f5ab0e69c5ecc468441a0ef1cc --- M pywikibot/page.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: Zhuyifei1999: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 9b6eb22..1718e08 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -3045,9 +3045,9 @@ authors = ', '.join(self.contributingUsers()) creation_summary = message % (self.title(), authors) newtext = self.get() - for regex_name in cfd_templates: - matchcfd = re.compile(r'{{%s.*?}}' % regex_name, re.IGNORECASE) - newtext = matchcfd.sub('', newtext) + for regex_name in cfd_templates: + matchcfd = re.compile(r'{{%s.*?}}' % regex_name, re.IGNORECASE) + newtext = matchcfd.sub('', newtext) matchcomment = re.compile( r'<!--BEGIN CFD TEMPLATE-->.*?<!--END CFD TEMPLATE-->', re.IGNORECASE | re.MULTILINE | re.DOTALL)
pywikibot-commits@lists.wikimedia.org