10000 gh-134322: fix the `__repr__` value of `threading.RLock` from `_thread`module, when just created by YvesDup · Pull Request #134389 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134322: fix the __repr__ value of threading.RLock from _threadmodule, when just created #134389

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

Merged
merged 5 commits into from
May 22, 2025

Conversation

YvesDup
Copy link
Contributor
@YvesDup YvesDup commented May 20, 2025

When a threading.RLock is just created, the value of _count attribute is set to 1 instead of 0.
Note that __repr__ is correct when _threadmodule is inactive.

@vstinner vstinner added the needs backport to 3.14 bugs and security fixes label May 20, 2025
@brettcannon brettcannon removed their request for review May 21, 2025 22:56
Copy link
Member
@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner vstinner enabled auto-merge (squash) May 22, 2025 16:26
@vstinner vstinner merged commit fade146 into python:main May 22, 2025
38 checks passed
@miss-islington-app
Copy link

Thanks @YvesDup for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2025
Fix the `__repr__` value of `threading.RLock` from `_thread` module, when just created.
(cherry picked from commit fade146)

Co-authored-by: Duprat <yduprat@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented May 22, 2025

GH-134528 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 22, 2025
@YvesDup YvesDup deleted the rlock-threading-erronous-count branch May 22, 2025 16:55
vstinner pushed a commit that referenced this pull request May 22, 2025
gh-134322: Fix `repr(threading.RLock)` (GH-134389)

Fix the `__repr__` value of `threading.RLock` from `_thread` module, when just created.
(cherry picked from commit fade146)

Co-authored-by: Duprat <yduprat@gmail.com>
lkollar pushed a commit to lkollar/cpython that referenced this pull request May 26, 2025
Fix the `__repr__` value of `threading.RLock` from `_thread` module, when just created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0