New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>:

If a warning is emitted then a filter with the "always" rule is added
then the is emitted again, it will not be shown the second time:

  [EMAIL PROTECTED]:~$ python
  Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
  [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import warnings
  >>> def f():
  ...     warnings.warn("foo")
  ... 
  >>> f()
  /home/exarkun/.pythonstartup.py:2: UserWarning: foo
  >>> warnings.simplefilter("always")
  >>> f()
  >>> 

The "always" filter is documented as "always print matching warnings"
which is contrary to this behavior.  Also, the string "always" strongly
implies that it will be shown the second time.

----------
messages: 75113
nosy: exarkun
severity: normal
status: open
title: warnings.simplefilter("always") does not make warnings always show up
versions: Python 2.4, Python 2.5, Python 2.6

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4180>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to