Message369809
Just ran into this myself -- not sure what the intended fix is (hopefully it's "add a function that restores the warnings configuration to its defaults?" Changing resetwarnings seems likely to be not doable I assume.)
But in the meanwhile, is a doc patch acceptable? The current documentation for resetwarnings is really deceptive, and makes it look like it does what @pitrou (and I) thought it did:
> Reset the warnings filter. This discards the effect of all previous calls to filterwarnings(), including that of the -W command line options and calls to simplefilter().
Compare to the docstring of the function (and to what it actually does):
> """Clear the list of warning filters, so that no filters are active."""
But there are still too many implementation details of the warnings module leaking through here -- for end users it's just "restore the warnings configuration to its defaults" (what it looks like resetwarnings should do) or "unfilter all warnings, even beyond the filters configured by default" (what it actually does).
Is at least making the docs reflect the latter a reasonable patch to submit, to start, while what to do about the former is thought about? |
|
Date |
User |
Action |
Args |
2020-05-24 16:40:35 | Julian | set | recipients:
+ Julian, ncoghlan, pitrou, Arfrever, stefanv, yaubi, docs@python, eric.snow, eli.collins, berker.peksag, robertmuil |
2020-05-24 16:40:34 | Julian | set | messageid: <1590338434.97.0.65941020515.issue21724@roundup.psfhosted.org> |
2020-05-24 16:40:34 | Julian | link | issue21724 messages |
2020-05-24 16:40:34 | Julian | create | |
|