-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logging.disable('WARN') breaks AsyncIO #86810
Comments
import logging
with logging.disable('WARN'): pass See: ipython/ipython#12713 |
Reporting what? Please elaborate. |
Everything's in the linked issue; in summary, the command kills IPython, and an IPython maintainer showed code suggesting the problem's rooted in CPython's improper handling of 'WARN' as alias for logging.WARN. |
The problem seems to be in the user code? As you were told by "Carreau", loggin.disable takes a logging level (an integer), since you're giving it a string which it dutifully stores, it blows up at the next logging call which happens to be in asyncio. This is not an asyncio bug, nor is it a crash anymore than passing a broken key function to At most it's an enancement request: |
I should have been more careful in my explanation in the upstream issue to have a complete report in here. I think that patching logging.disable to raise a type error immediately would be welcome; as the effect of storing a wrong type make any asyncio application fails in place that can be relatively remote from the location of the erroneous value, and could be quite hard to debug in other circumstances. |
FWIW [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 |
Oh I now see you've created a PR to do essentially that, nm. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: