Message320662
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:17 | erik.bray | set | recipients:
+ erik.bray, pitrou, Gerrit.Holl, serhiy.storchaka, Segev Finer |
| 2018-06-28 11:56:17 | erik.bray | set | messageid: <[email protected]> |
| 2018-06-28 11:56:17 | erik.bray | link | issue29672 messages |
| 2018-06-28 11:56:17 | erik.bray | create | |
|