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))
--
To view, visit https://gerrit.wikimedia.org/r/223882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9de69215f98ca583e636b41734ee8effaca5dbee
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits