[Python-Dev] module extension search order - can it be changed?
Just van Rossum
just@letterror.com
Tue, 25 Feb 2003 21:32:49 +0100
Bill Bumgarner wrote:
> On Tuesday, Feb 25, 2003, at 15:04 US/Eastern,
> python-dev-request@python.org wrote:
> > python23.zip is good for end users of programs written in Python,
> > but not so good for Python programmers: AFAIK it won't show source
> > lines in tracebacks for modules loaded from the zip file.
>
> Speaking entirely from a point of ignorance, why are the source line
> #s not shown for frames that are implemented in modules loaded from
> zipimport?
Line *numbers* will be shown, the lines themselves won't.
> Assuming the ZIP archive could be exactly identical to what one might
> find in /usr/lib/python2.3/, the zip could contain all the py + pyc as
> found in the normal library?
Yes, but currently the traceback logic that shows the offending line
(the line itself, not the line number) depends on the source being in
the actual file system. While this _could_ be fixed for zipimport, it's
not entirely trivial. You should be able to find looong discussions
about this topic in the python-dev archives... Also check PEP 302.
Just