Skip to content

AcquirerProxy object has no attribute locked #115942

Description

@ccaruceru

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

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Feb 26, 2024
  2. added a commit that references this issue on Feb 26, 2024
  3. sobolevn commented on Feb 26, 2024

    @sobolevn
    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.

  4. added a commit that references this issue on Apr 8, 2025
  5. sobolevn commented on Apr 8, 2025

    @sobolevn
    Member

    3.14 will have this new feature :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions