-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Update logging library module lock to use context manager to acquire/release lock. #109461
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
type-feature
A feature request or enhancement
Comments
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 15, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 15, 2023
…ock-acquisition' into pythongh-109461-update-logging-lock-acquisition
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 15, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 15, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 16, 2023
…ock-acquisition' into pythongh-109461-update-logging-lock-acquisition
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 16, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 16, 2023
…ock-acquisition' into pythongh-109461-update-logging-lock-acquisition
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 18, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 21, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 21, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 21, 2023
…ock-acquisition' into pythongh-109461-update-logging-lock-acquisition
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 21, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 22, 2023
dcollison
added a commit
to dcollison/cpython
that referenced
this issue
Sep 22, 2023
AA-Turner
added a commit
to dcollison/cpython
that referenced
this issue
Sep 26, 2023
vstinner
added a commit
that referenced
this issue
Sep 27, 2023
Co-authored-by: Victor Stinner <vstinner@python.org>
csm10495
pushed a commit
to csm10495/cpython
that referenced
this issue
Sep 28, 2023
…ython#109462) Co-authored-by: Victor Stinner <vstinner@python.org>
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this issue
Jun 25, 2024
See python/cpython#109461 Using it as a context manager already works fine in earlier Python versions too. See #8205
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
…ython#109462) Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature or enhancement
Proposal:
Current implementation relies on both
_acquireLock()
and_releaseLock()
being called, otherwise a lock may never be released:The majority of usages of
_acquireLock()
manually add a try/except/finally block to ensure that the lock is released if an exception is thrown. Some usages of_acquireLock()
have no safety.The proposal is to alter the usage of
_acquireLock()
to be a context manager that deals with acquiring and releasing automatically rather than requiring try/except/finally blocks to be used anywhere the function is called.For example,
usage before:
proposed usage:
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: