TencentCloud / TencentCloud/tencentcloud-sdk-python

return in finally swallows exceptions

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

Nobody has claimed this yet.

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

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.

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.