Does linecache work with source in Python eggs? If not, is it contemplated that this is going to be fixed or is there something else like linecache that currently works?
Right now, I think pdb and pydb (and probably other debuggers) are broken when they try to trace into code that is part of an egg. Here's what I tried recently: Using this egg: http://pypi.python.org/packages/2.5/t/tracer/tracer-0.1.0-py2.5.egg I install that and look for the filename of one of the functions. Here's a sample session: >>> import tracer >>> tracer <module 'tracer' from '/usr/lib/python2.5/site-packages/tracer-0.1.0-py2.5.egg/tracer.pyc'> >>> tracer.size <function size at 0xb7c39a74> >>> tracer.size.func_code.co_filename 'build/bdist.linux-i686/egg/tracer.py' >>> tracer.size.func_code.co_firstlineno 216 >>> To read the source for tracer.py, information from "Accessing Package Resources" (http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources) suggests: >>> from pkg_resources import resource_string >>> print resource_string('tracer', 'tracer.py') This gives me one long string which I can split and then index. Note that I used "tracer.py" above, not "build/bdist.linux-8686/egg/tracer.py" How do tracebacks and things that read frame information deal with the discrepency? Before reinventing the wheel and trying to extend linecache to do something like the above, has someone already come up with a solution? Thanks -- http://mail.python.org/mailman/listinfo/python-list