Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1306106?usp=email )

Change subject: interwiki: catch OSError while writing a dump
......................................................................

interwiki: catch OSError while writing a dump

Bare except for 'Exception' is too broad and may catch unintended errors.
Use OSError instead.

Change-Id: Ibd474128cf710f0f046415fc8080d12059656b15
---
M scripts/interwiki.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 1d0b941..d1aeda3 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -1218,8 +1218,8 @@
                         f.write(
                             f' [{config.interwiki_graph_url}{filename} graph]')
                     f.write('\n')
-            # FIXME: What errors are we catching here?
-            except Exception:
+            # Catch file operation failures while writing autonomous dump.
+            except OSError:
                 pywikibot.info(
                     'File autonomous_problems.dat open or corrupted! '
                     'Try again with -restore.')

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1306106?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: Ibd474128cf710f0f046415fc8080d12059656b15
Gerrit-Change-Number: 1306106
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[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]

Reply via email to