[issue1309567] linecache module returns wrong results
David Zaslavsky
report at bugs.python.org
Mon Jan 5 10:59:44 CET 2009
David Zaslavsky <diazona+py at ellipsix.net> added the comment:
I just had the same problem in a call to inspect.findsource()
(actually my code calls inspect.stack() which calls ... which calls
findsource()). The code object passed to findsource() had a filename
of "database/__init__.py" which is the correct filename relative to
sys.path, so in this case a simple fix would have worked: delete line
82 of linecache.py
82 basename = os.path.split(filename)[1]
and use filename instead of basename for the rest of the function. (Or
for a quick hack, change line 82 to just "basename = filename")
I'm using Python 2.5.2 but the relevant code in linecache.py also
exists in 3.0 (just checked).
----------
nosy: +diazona
versions: +Python 3.0
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1309567>
_______________________________________
More information about the Python-bugs-list
mailing list