Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1085351?usp=email )
Change subject: [bugfix] strip newlines from pairsfile lines
......................................................................
[bugfix] strip newlines from pairsfile lines
Bug: T378647
Change-Id: I7c07398dfdcc80d3a0a45b4151438819c4d96cec
---
M scripts/replace.py
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/scripts/replace.py b/scripts/replace.py
index 5b04af1..d17bb8a 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -848,8 +848,7 @@
'Please enter the filename to read replacements from:')
try:
- with Path(filename).open(encoding='utf-8') as f:
- replacements = f.readlines()
+ replacements = Path(filename).read_text(encoding='utf-8').splitlines()
if not replacements:
raise OSError(f'{filename} is empty.')
except OSError as e:
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1085351?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7c07398dfdcc80d3a0a45b4151438819c4d96cec
Gerrit-Change-Number: 1085351
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]