[issue21724] resetwarnings doesn't reset warnings registry

2021-10-23 Thread Yoann Aubineau


Change by Yoann Aubineau :


--
nosy:  -yaubi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2021-10-23 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@Julian Am leaning more into us applying a relevant fix, than adjusting the 
documentation.

--
nosy: +nanjekyejoannah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2020-05-24 Thread Julian Berman


Julian Berman  added the comment:

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?

--
assignee:  -> docs@python
components: +Documentation
nosy: +Julian, docs@python
versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2015-07-26 Thread Eli Collins

Eli Collins added the comment:

I'm not sure how generally applicable this is, but it might be useful as a 
starting point:  Attached is a bit of code I've been using: it's a 
reset_warnings_registry() context manager, which backs up & clears the registry 
state for the duration of the context, then restores it afterwards.  

It's particularly useful for unittests, just create & call the __enter__() 
method during setUp(), and attach __exit__() via addCleanup.  Each test is then 
gets it's own isolated warnings registry.

--
nosy: +eli.collins
Added file: http://bugs.python.org/file40031/reset_warning_registry.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-11-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-11-10 Thread Robert Muil

Changes by Robert Muil :


--
nosy: +robertmuil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-07-28 Thread Yoann Aubineau

Changes by Yoann Aubineau :


--
nosy: +yaubi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-06-14 Thread Stefan van der Walt

Stefan van der Walt added the comment:

This can be quite painful to work around, since the warning registry is 
scattered all over.  See, e.g.,

https://github.com/scikit-image/scikit-image/blob/master/skimage/_shared/_warnings.py#L9

--
nosy: +stefanv

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-06-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Related indeed, though not exactly the same issue. What I'd like is to reset 
(i.e. clear) the registry even when keeping the default warning scheme.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-06-11 Thread Berker Peksag

Berker Peksag added the comment:

> It makes it difficult to get repeatable warning messages, e.g. at the > 
> command prompt, because the shortcut path will silence messages which > were 
> already emitted, even if the filter have been changed to "always" > 
> in-between.

This could be related to issue 4180.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21724] resetwarnings doesn't reset warnings registry

2014-06-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

There seems to be no (official) way to reset the warnings registry; in 
particular, resetwarnings() doesn't reset it. It makes it difficult to get 
repeatable warning messages, e.g. at the command prompt, because the shortcut 
path will silence messages which were already emitted, even if the filter have 
been changed to "always" in-between.

--
messages: 220282
nosy: brett.cannon, eric.snow, ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: resetwarnings doesn't reset warnings registry
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com