oci-cli icon indicating copy to clipboard operation
oci-cli copied to clipboard

return in finally can swallow exceptions

Open iritkatriel opened this issue 1 year ago • 0 comments

In https://github.com/oracle/oci-cli/blob/40b5ec913d23c5f252482a5a125f91f7648d8856/src/oci_cli/cli_util.py#L2079 there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if a BaseException (such as KeyboardInterrupt) is raised from the body, or any exception is raised from one of the except: clauses, it will not propagate on as expected.

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

iritkatriel avatar Oct 24 '24 13:10 iritkatriel