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 erik.bray
Recipients Gerrit.Holl, Segev Finer, erik.bray, pitrou, serhiy.storchaka
Date 2018-06-28.11:56:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I just encountered this as well.  The way catch_warnings is implemented is a bit "dumb" in how it treats _filter_version (it calls _filters_mutated even if the active filters are not actually changed when entering catch_warnings).

More significantly, _filter_version is not fine-grained enough.  If some warning was already displayed, calling catch_warnings() should not later cause that same warning to be displayed again unless the filters were modified in such a way, during catch_warnings(), that that warning should be displayed (e.g. changed to 'always').

I'm not really sure what to do about that though.  Maybe the "filter version" should be per-warning?  Currently the value assigned to each warning in __warningregistry__ is not used (it is just set to True), so maybe that could actually be used for this.
Date User Action Args
2018-06-28 11:56:17erik.braysetrecipients: + erik.bray, pitrou, Gerrit.Holl, serhiy.storchaka, Segev Finer
2018-06-28 11:56:17erik.braysetmessageid: <>
2018-06-28 11:56:17erik.braylinkissue29672 messages
2018-06-28 11:56:17erik.braycreate