Skip to content
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 can swallow exceptions #406

Open
iritkatriel opened this issue Oct 22, 2024 · 2 comments
Open

return in finally can swallow exceptions #406

iritkatriel opened this issue Oct 22, 2024 · 2 comments
Labels

Comments

@iritkatriel
Copy link

In

return jsondata.get("data")
there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if an exception other than ValueError(includingBaseException such as KeyboardInterrupt) is raised from the try body, or any exception is raised from an except: clause, it will not propagate on as expected.

See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.

@donations-bot-prod
Copy link

Donation bot here. Supporters can mark their interest in this issue by adding a comment
starting with "+1" (without quotes) or adding the "#supporter_sponsor" keyword
(without quotes) in their comments.

You can become a donor by subscribing as Sponsor from the GitHub sponsorship page or from the BuyMeACoffee page.

Issues marked by donors will be labeled accordingly and handled with special care

Copy link

stale bot commented Dec 28, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant