[New-bugs-announce] [issue20247] Condition._is_owned is wrong

Antony Lee report at bugs.python.org
Tue Jan 14 01:55:21 CET 2014

New submission from Antony Lee:

I believe that the implementation of Condition._is_owned is wrong, as mentioned here: https://mail.python.org/pipermail/python-list/2012-October/632682.html.  Specifically, the two return values (True and False) should be inverted.

I guess this slipped through as this private function would only be called if one passed to a Condition object a (R)Lock-like object that doesn't define _is_owned.  (I noticed this when I tried to pass a custom-written reader-writer lock to a Condition object.)  Technically, the docs says that "If the lock argument is given and not None, it must be a Lock or RLock object", but in practice anything that defines acquire(), release() (and possibly _is_owned()) should work.

components: Library (Lib)
messages: 208063
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Condition._is_owned is wrong

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list