TencentCloud / TencentCloud/tencentcloud-sdk-python

Incompatibility with Python 3.14

Open Beginner friendly
#229 0 comments 2 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

Python 3.14 now raises a SyntaxWarning when a break, continue or return statement is used in a finally block.

As a consequence, the following code fails in strict test environments, and will fail in the future on production:

https://github.com/TencentCloud/tencentcloud-sdk-python/blob/a7e8b98b74ccc9d303b02b88a8d2b5d97b89ab73/tencentcloud/common/credential.py#L126-L135

The fix seems pretty straightforward: the final return self.role should be made in the try block because if it fails, an exception will be raised and no value would be returned anyway.

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 with tencentcloud/common/credential.py at lines 126-135, where the reported finally-block control flow occurs. Check the behavior under Python 3.14 and the project's strict test environment; done means the warning is no longer produced while the credential behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.