[issue4182] warnings.warn shows the wrong filename and line number for stacklevel of 0

Benjamin Peterson report at bugs.python.org
Thu Oct 23 00:34:37 CEST 2008


Benjamin Peterson <musiccomposition at gmail.com> added the comment:

The reason for this is that the C implementation of warnings doesn't
show up on the frame stack. (The pure Python implementation of warnings
in 2.6 works like in 2.5.) The only solution for this one might be using
the Python implementation. (I'd also be interested to know why a
stacklevel of 0 is being used.)

----------
nosy: +benjamin.peterson, brett.cannon

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4182>
_______________________________________


More information about the Python-bugs-list mailing list