jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
cosmetic_changes.py: Do not convert text to byte string

This may cause UnicodeEncodeError on Python 2. See
https://lists.wikimedia.org/pipermail/pywikibot/2018-May/009829.html.

Change-Id: I50bde45c7288b3e400bfd2d5c333206811527de6
---
M pywikibot/cosmetic_changes.py
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 3975096..a01d7f2 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -659,7 +659,8 @@
for template in skip_templates[self.site.code]:
skip_regexes.append(
re.compile(r'\{\{\s*%s\s*\}\}' % template, re.I))
- stripped_text = str(text)
+
+ stripped_text = text
for reg in skip_regexes:
stripped_text = reg.sub(r'', stripped_text)

To view, visit change 436028. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I50bde45c7288b3e400bfd2d5c333206811527de6
Gerrit-Change-Number: 436028
Gerrit-PatchSet: 2
Gerrit-Owner: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot <>