[issue25668] Deadlock in logging caused by a possible race condition with "format"

Irit Katriel report at bugs.python.org
Sun Dec 5 17:46:55 EST 2021


Irit Katriel <iritkatriel at gmail.com> added the comment:

> Please tell me what is unusual for you with this testcase?

Grabbing a lock in __str__/__repr__ strikes me as unusual and a recipe for problems.

You don't really know when those functions are called - from the debugger, from exception handlers, etc..   Even if the logging module protected you from the deadlock you found, you won't be safe from similar situations with other libraries that use locks.

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25668>
_______________________________________


More information about the Python-bugs-list mailing list