Multiprocessing Lock and RLock - invalid representation string on MacOSX. #125679
Labels
stdlib
Python modules in the Lib dir
topic-multiprocessing
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
Due of absence of the
sem_getvalue
C function in the MacOSX semaphore implementation,Lock
andRLock
representation strings are invalid in themultiprocessing
module.Call to
self._semlock._get_value()
raises an exception, and set part of repr with 'unknown'.I propose to replace in the
__repr__
method of each class the following test:cpython/Lib/multiprocessing/synchronize.py
Line 177 in 37e533a
cpython/Lib/multiprocessing/synchronize.py
Line 203 in 37e533a
with
elif not self._semlock._is_zero():
.This method is available and valid on each OS.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: