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 Julian
Recipients Arfrever, Julian, berker.peksag, docs@python, eli.collins, eric.snow, ncoghlan, pitrou, robertmuil, stefanv, yaubi
Date 2020-05-24.16:40:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:35Juliansetrecipients: + Julian, ncoghlan, pitrou, Arfrever, stefanv, yaubi, docs@python, eric.snow, eli.collins, berker.peksag, robertmuil
2020-05-24 16:40:34Juliansetmessageid: <>
2020-05-24 16:40:34Julianlinkissue21724 messages
2020-05-24 16:40:34Juliancreate