This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients barry, vstinner
Date 2017-11-20.15:00:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511190044.67.0.213398074469.issue32088@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-11-20 15:00:44vstinnersetrecipients: + vstinner, barry
2017-11-20 15:00:44vstinnersetmessageid: <1511190044.67.0.213398074469.issue32088@psf.upfronthosting.co.za>
2017-11-20 15:00:44vstinnerlinkissue32088 messages
2017-11-20 15:00:44vstinnercreate