Internal Debugger Question

Just just at
Tue Sep 16 18:41:28 CEST 2003

In article <7h3r82gem0k.fsf at>,
 Michael Hudson <mwh at> wrote:

> llothar at (Lothar Scholz) writes:
> > i'm currently writing a debugger for python and found that some
> > modules store an absolute file path in "co_filename" of there
> > methods/functions and some store a relative file path. Because the
> > relative file path can never be expanded to an absolute file path
> > later (the sys.path may have changed) it is impossible to find the
> > source code location.
> > 
> > Is there anything i have missed or is this simply a bug. I would
> > highly recommend to fix this bug !
> I belive this is one of the oldest open bug reports on SF... I spent a
> few minutes looking at it, before deciding I didn't care enough to fix
> it.  Your point of view may be different:
> Be warned, the import code is some of the most frightening (to me,
> anyway) code in Python.

A workaround may be to look at __file__ in the frame's f_globals field. 
I'm moderately confident that that one gets set correctly upon import.


More information about the Python-list mailing list