return in finally swallows exceptions

Open
#195 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by reading tencentcloud/common/credential.py at line 122 and the linked Python cleanup-actions documentation. Verify how exceptions from the try body and except clause behave around the finally block. Done means those exceptions propagate instead of being swallowed.

Written by the indexing model from the issue text.

Description

In https://github.com/TencentCloud/tencentcloud-sdk-python/blob/258662e27ed87c3e644447f5a441fedbf773cc40/tencentcloud/common/credential.py#L122 there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if an unhandled exception (including a BaseException 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.

Dominant language
Python
Stars
713
Forks
252
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TencentCloud/tencentcloud-sdk-python

All issues in TencentCloud/tencentcloud-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.