[issue9948] findCaller is slow and loses case information on Windows

Armin Ronacher report at bugs.python.org
Sun Sep 26 22:02:19 CEST 2010


Armin Ronacher <armin.ronacher at active-4.com> added the comment:

> 1. Users can use _srcFile = None to avoid calling findCaller() 
> altogether, so I can't do away with the _srcFile altogether as it may 
> cause some issues with existing code.
That is very undocumented behaviour and relying on that sounds like a terrible idea.

> 2. If using e.g. a LoggerAdapter derived class, there needs to be 
> some way in which you can skip (in addition to the logging package 
> itself) other user-defined modules until you get to the appropriate 
> stack frame.
First of all that should not be a global setting, secondly this is currently not possible in logging either.  A better solution would be to do what warnings does and making it possible provide a stacklevel to the caller finder.

----------

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


More information about the Python-bugs-list mailing list