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 exarkun
Recipients exarkun
Date 2008-10-22.21:49:30
SpamBayes Score 4.7812136e-06
Marked as misclassified No
Message-id <1224712172.47.0.998538899646.issue4180@psf.upfronthosting.co.za>
In-reply-to
Content
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:

  exarkun@charm:~$ 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.
History
Date User Action Args
2008-10-22 21:49:32exarkunsetrecipients: + exarkun
2008-10-22 21:49:32exarkunsetmessageid: <1224712172.47.0.998538899646.issue4180@psf.upfronthosting.co.za>
2008-10-22 21:49:31exarkunlinkissue4180 messages
2008-10-22 21:49:30exarkuncreate