jenkins-bot merged this change.

View Change

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

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)

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I589c17af428c48f5ab0e69c5ecc468441a0ef1cc
Gerrit-Change-Number: 487067
Gerrit-PatchSet: 4
Gerrit-Owner: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)