Problem with inspect.getfile

elventear elventear at gmail.com
Tue May 1 13:48:35 EDT 2007


Hello,

I am trying to use someone else's module that makes use of
inspect.getsourcelines. The code was not working for me, so I have
been debugging to see why it is not working. I have reduced my problem
to getting the wrong file path in the getfile->return
object.co_filename call.

Basically the path I get is:

"/Users/elventear/Documents/UTMEM/Projects/geotools/parsers/parser.py"

When the correct path should be:

"/Users/elventear/Documents/UTMEM/Projects/packages/geotools/parsers/
parser.py"

Finally my PYTHONPATH contains:

"/Users/elventear/Documents/UTMEM/Projects/packages"

So basically, I am able to resolve correctly the package from withing
Python, I don't know why there is this confusion about the filename
that contains my objects and methods.

Any ideas on how to correct this would be appreciated.

This is under MacOSX 10.4.9, Python 2.5 (Build from Fink).

Thanks!




More information about the Python-list mailing list