-
-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode #76269
Comments
Related python-dev thread: I propose to display Display DeprecationWarning, PendingDeprecationWarning and ImportWarning when Python is compiled in debug mode. Attached PR implements proposed change. |
Warnings filters in debug mode. Reference (current code): $ ./python -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('ignore', None, <class 'DeprecationWarning'>, None, 0),
('ignore', None, <class 'PendingDeprecationWarning'>, None, 0),
('ignore', None, <class 'ImportWarning'>, None, 0),
('ignore', None, <class 'BytesWarning'>, None, 0),
('always', None, <class 'ResourceWarning'>, None, 0)] With my PR 4474: $ ./python -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('ignore', None, <class 'BytesWarning'>, None, 0),
('always', None, <class 'ResourceWarning'>, None, 0)] BytesWarning is not modified by my PR since this specific warning is controlled by the -b option. Example with my PR. -b option, ignore => default: $ ./python -b -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('default', None, <class 'BytesWarning'>, None, 0),
('always', None, <class 'ResourceWarning'>, None, 0)] -bb option, ignore => error: $ ./python -bb -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('error', None, <class 'BytesWarning'>, None, 0),
('always', None, <class 'ResourceWarning'>, None, 0)] Note: While writing this comment, I also found a bug in the new developer mode (-X dev): bpo-32089. |
Merged. This is an important improvement to make sure 3.7's quality is the best possible. Thanks! ✨ 🍰 ✨ |
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: