Merlijn van Deen has submitted this change and it was merged.
Change subject: replace.py: remove line endings when reading from file ......................................................................
replace.py: remove line endings when reading from file
Use file.read().splitlines() to prevent spaces from also being stripped.
Change-Id: I9de69215f98ca583e636b41734ee8effaca5dbee --- M scripts/replace.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py index f5eeeb6..31188d8 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -817,7 +817,8 @@ if replacement_file: try: with codecs.open(replacement_file, 'r', 'utf-8') as f: - file_replacements = f.readlines() + # strip newlines, but not other characters + file_replacements = f.read().splitlines() except (IOError, OSError) as e: pywikibot.error(u'Error loading {0}: {1}'.format( replacement_file, e))
pywikibot-commits@lists.wikimedia.org