You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of issue or feature request:
An (anti)pattern starts to appear in the newer code (where stricter pylint checks are applied), a tendency to disable broad-except warnings.
Even though each case has its arguments, we should as a minimum make sure we log the exception and not silently bury it.
Current behavior: # pylint: disable=broad-except throughout the code
Expected behavior:
At least log the exception before ignoring it:
try:
do_something()
except Exception as e:
logger.exception("An exception occurred")
The text was updated successfully, but these errors were encountered:
sechkova
changed the title
Revise the disabling of broad-except pylint warnings
Revise the disabling of broad-except pylint warning (W0703)
Apr 6, 2021
It's possible that the deserialization cases are actually appropriate (I'm not sure if we can figure out all the ways that deserialization can fail, and the callers certainly won't care too much) but you are right we should review this.
jku
added
the
backlog
Issues to address with priority for current development goals
label
May 26, 2021
I tested this with the intention to close the issue since the disable is well justified in serialisation/json.py and another exception is re-raised from the broad one ... but surprisingly pylint agrees with us! Pylint does not emit the error anymore and the disabling is not needed ... it was needed when python 2.x was supported and six was used (see bd94f6d).
Assigning this to myself to fix it (remove the disabling of the warning).
Description of issue or feature request:
An (anti)pattern starts to appear in the newer code (where stricter
pylint
checks are applied), a tendency to disable broad-except warnings.Even though each case has its arguments, we should as a minimum make sure we log the exception and not silently bury it.
Current behavior:
# pylint: disable=broad-except
throughout the codeExpected behavior:
At least log the exception before ignoring it:
Sync with #1178
The text was updated successfully, but these errors were encountered: