[ python-Bugs-1068477 ] linecache.py::updatecache strips directory info from files

SourceForge.net noreply at sourceforge.net
Fri Nov 19 00:38:55 CET 2004


Bugs item #1068477, was opened at 2004-11-18 17:32
Message generated for change (Settings changed) made by tleslie
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1068477&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Leslie (tleslie)
Assigned to: Nobody/Anonymous (nobody)
>Summary: linecache.py::updatecache strips directory info from files

Initial Comment:
If a filename couldn't be stat()ed, the code tries to
find it in sys.path. To do this it only takes the
filename and drops any preceding directories.

If the file happens to reside in a package, the name of
the package is lost, which can lead to badness. Eg, if
you have my_package/__init__.py, then just the file
__init__.py will be searched for, which may well be
found in the cache from a different package. This leads
to the wrong file being returned.

This bit me as a result of using pydoc on a set of my
packages. I'll try to put together a minimal example
which demonstates the behaviour.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1068477&group_id=5470


More information about the Python-bugs-list mailing list