[issue24490] DeprecationWarning hidden even after warnings.filterwarnings('always') called

2015-06-23 Thread Jakub Mateusz Kowalski

New submission from Jakub Mateusz Kowalski:

The error occurs when there was a warning before the call to filterwarnings():

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type help, copyright, credits or license for more information.
 import warnings
 warnings.warn('aa', DeprecationWarning)
 warnings.filterwarnings('always')
 warnings.warn('aa', DeprecationWarning)


When filterwarnings() is called before warnings, everything is working as 
expected:

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type help, copyright, credits or license for more information.
 import warnings
 warnings.filterwarnings('always')
 warnings.warn('aa', DeprecationWarning)
__main__:1: DeprecationWarning: aa
 warnings.warn('aa', DeprecationWarning)
__main__:1: DeprecationWarning: aa


--
components: Interpreter Core
messages: 245691
nosy: Jakub.Mateusz.Kowalski
priority: normal
severity: normal
status: open
title: DeprecationWarning hidden even after warnings.filterwarnings('always') 
called
type: behavior
versions: Python 2.7

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



[issue24490] DeprecationWarning hidden even after warnings.filterwarnings('always') called

2015-06-23 Thread Ned Deily

Ned Deily added the comment:

The problem you describe was covered by Issue4180 and fixed in Python 3.4.2.  
From the discussion there, you can see that it was decided to not change the 
behavior of Python 2.7.

--
nosy: +ned.deily
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - warnings.simplefilter(always) does not make warnings always 
show up

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