jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/444025 )
Change subject: [bugfix] Terminate script instead of raising an error
......................................................................
[bugfix] Terminate script instead of raising an error
If an IOError occurs during read operation a bad nested IOError occurs.
with a loth of traceback lines.
Now the script terminate with just showing that exception.
Change-Id: Ib4808beaf936a7243bc5ef6fba1978f0f2c24920
---
M scripts/pagefromfile.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Zhuyifei1999: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 31ad263..7fdac72 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -224,9 +224,9 @@
encoding=config.textfile_encoding) as f:
text = f.read()
- except IOError as err:
- pywikibot.output(str(err))
- raise IOError
+ except IOError:
+ pywikibot.exception()
+ return
position = 0
length = 0
--
To view, visit
https://gerrit.wikimedia.org/r/444025
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4808beaf936a7243bc5ef6fba1978f0f2c24920
Gerrit-Change-Number: 444025
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot