jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1332248?usp=email )
Change subject: solve_disambiguation: Handle ignore file read errors
......................................................................
solve_disambiguation: Handle ignore file read errors
A suppressed read error leaves text undefined and raises
UnboundLocalError while parsing the optional primary ignore file.
Return on OSError, preserving the initialized ignore list as the
pre-pathlib implementation did.
Change-Id: I5cd04738f19305c04dca351be021ee46f4f58fa7
---
M scripts/solve_disambiguation.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 932f425..db69baf 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -472,8 +472,10 @@
# The file is stored in the disambiguation/ subdir.
# Create if necessary.
- with suppress(IOError):
+ try:
text = filepath.read_text(encoding='utf-8')
+ except OSError:
+ return
# skip empty lines
self.ignorelist = {line for line in text.splitlines() if line}
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1332248?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: I5cd04738f19305c04dca351be021ee46f4f58fa7
Gerrit-Change-Number: 1332248
Gerrit-PatchSet: 1
Gerrit-Owner: Mahveotm <[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]