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:
pywikibot-commits@lists.wikimedia.org