[logging] problems in Python 2.3

Jim Jewett JimJJewett at yahoo.com
Wed Feb 25 05:19:21 CET 2004


Frantisek Fuka <fuka at fuxoft.cz> wrote in message news:<c15rkc$2ea5$1 at ns.felk.cvut.cz>...
> In fact, no matter from which module I call the logging method, 
> the resulting log says that the filename of the caller is:

> \tmp\python.2664\usr\lib\python2.3\logging\__init__.py
 
> (this seems to me like a reference to the logging module itself combined 
> with some sort of weird temporary storage)

Are you by any chance running from inside an editor, such as
emacs or even idle?  If the module somehow gets hold of a 
second sourcefile (and this looks like a copy tied to your
current process -- like the names for toplevel under emacs),
then this won't match the original __srcfile__.

You may wish to override the portion that finds a caller, so
that it will throw out, say, anything matching .*\logging\__init__.py([co])?

-jJ



More information about the Python-list mailing list