[issue1309567] linecache module returns wrong results

Jean-Paul Calderone report at bugs.python.org
Sat Nov 1 20:25:23 CET 2008


Jean-Paul Calderone <exarkun at divmod.com> added the comment:

This is still relevant.  It makes linecache (and therefore some other
things, like inspect.getsource) almost useless in many cases.  For
example, because of this, sometimes inspect.getsource will raise an
IOError and sometimes it will return garbage data.  If the source file
isn't around, it'd be much better to fail all the time.  Rummaging
around in the filesystem hoping to get lucky and find another file with
the same name which contains the correct contents is insane.  This may
have made sense when relative path names were being used, but it makes
no sense anymore.

----------
nosy: +exarkun

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


More information about the Python-bugs-list mailing list