-
-
Notifications
You must be signed in to change notification settings - Fork 32k
repr
of threading.RLock
is erronous with the _thread
module
#134322
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
Labels
Comments
Yes, it's because of: size_t count = self->lock.level + 1; which doesn't check whether the lock is unlocked or not. |
Yes, we have to check the lock state as in the |
It's a regression introduced in Python 3.14 by commit 67f6e08. cc @kumaraditya303
|
Python 3.13 is not affected:
|
vstinner
pushed a commit
that referenced
this issue
May 22, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
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>
vstinner
pushed a commit
that referenced
this issue
May 22, 2025
lkollar
pushed a commit
to lkollar/cpython
that referenced
this issue
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
Labels
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
output is:
The
threading.RLock.__repr__
seems to me erronous because when athreading.RLock
is just created, itscount
attribute should be 0.This error occurs only with the
_thread
module.I can submit a PR.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
__repr__
value ofthreading.RLock
from_thread
module, when just created #134389repr(threading.RLock)
(GH-134389) #134528The text was updated successfully, but these errors were encountered: