[issue42644] logging.disable('WARN') breaks AsyncIO
Xavier Morel
report at bugs.python.org
Tue Dec 15 13:19:47 EST 2020
Xavier Morel <xavier.morel at masklinn.net> added the comment:
> I think that patching logging.disable to raise a type error immediately would be welcome
FWIW `logging` has a built-in checker / converter[0] which is already used in a bunch of places (e.g. the aforementioned setLevel), it could just be added inside `disable` in the same way it's used in setLevel[1] and would uniformly convert "level names" to proper levels or raise an error. That seems like a really easy patch / contribution.
[0] https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L189
[1] https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L906
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42644>
_______________________________________
More information about the Python-bugs-list
mailing list