-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return in finally swallows exceptions #13
Comments
Thanks. I considered it acceptable because I thought that try-block would only raise an partial-json-parser/src/partial_json_parser/core/complete.py Lines 26 to 33 in 265c965
Did you find some other exceptions raised but shallowed inside that block? |
I see. You meant Why do you want to interrupt that process? Are you trying to parse a long string with a lot of spaces? |
I'm not using this code. I am doing static analysis of many open source projects to understand usages of finally (and incidentally reporting problems when I see them). |
If your intention is to swallow all exceptions, I'd do that with explicitly with |
Thanks for reporting. And I'm a bit curious if you are working on a linting tool or if you are involved in some statistical research? I would love to learn about your findings. |
|
thx! |
In
partial-json-parser/src/partial_json_parser/core/complete.py
Line 32 in 265c965
return
statement in afinally
block, which would swallow any in-flight exception.This means that if any exception is raised from the
try
body (includingBaseException
such asKeyboardInterrupt
), it will not propagate on as expected.See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.
The text was updated successfully, but these errors were encountered: