Skip to content
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

AcquirerProxy object has no attribute locked #115942

Open
ccaruceru opened this issue Feb 26, 2024 · 1 comment
Open

AcquirerProxy object has no attribute locked #115942

ccaruceru opened this issue Feb 26, 2024 · 1 comment
Labels
stdlib Python modules in the Lib dir topic-multiprocessing type-bug An unexpected behavior, bug, or error

Comments

@ccaruceru
Copy link

ccaruceru commented Feb 26, 2024

Bug report

Bug description:

According to the documentation, both multiprocessing.Manager.Lock and RLock should be the equivalent of an threading.Lock and RLock, but the underlying AcquirerProxy is missing the implementation of the .locked() method to query the state of the lock.

E.g.

from multiprocessing import Manager
from threading import Lock

if __name__ == "__main__":
    lock_th = Lock()
    lock_th.locked()  # this one works

    with Manager() as manager:
        lock_man = manager.Lock()
        lock_man.locked()  # this throws an "AttributeError: 'AcquirerProxy' object has no attribute 'locked'"

CPython versions tested on:

3.11, 3.12

Operating systems tested on:

Linux, macOS

Linked PRs

@ccaruceru ccaruceru added the type-bug An unexpected behavior, bug, or error label Feb 26, 2024
@Eclips4 Eclips4 added the stdlib Python modules in the Lib dir label Feb 26, 2024
sobolevn added a commit to sobolevn/cpython that referenced this issue Feb 26, 2024
@sobolevn
Copy link
Member

We clearly can do that. But, I cannot judge if we should: #115944

I am not a field expert in multiprocessing, so I might miss a lot of things here. But, it seems rather straight-forward at the first sight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-multiprocessing type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants