Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21253

Re: Error with co_filename when loading modules from zip file

Date 2012-03-05 21:40 -0500
From Bob Rossi <bob@brasko.net>
Subject Re: Error with co_filename when loading modules from zip file
References <mailman.410.1330979936.3037.python-list@python.org> <c1e15a96-3e77-4d7e-b684-d1b8a2bd49b1@p13g2000yqd.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.418.1331001742.3037.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Mar 05, 2012 at 02:22:55PM -0800, Vinay Sajip wrote:
> On Mar 5, 8:36 pm, Bob <b...@brasko.net> wrote:
> 
> > The logging package gets the filename and line number
> > of the calling function by looking at two variables, the filename
> > of the frame in the stack trace and the variable logging._srcfile.
> > The comparison is done in logging/__init__.py:findCaller.
> >
> 
> The _srcfile is computed in logging/__init__.py - can you see which of
> the paths it takes when computing _srcfile?
> 
> > I've tried putting only the pyc files, only the py files
> > and both in the zip file.
> 
> I think the filename info might be stored in the .pyc from when you
> ran it outside the .zip. If you delete all .pyc files and only
> have .py in the .zip, what happens?

Darn it, this was reported in 2007
  http://bugs.python.org/issue1180193
and it was mentioned the logging package was effected.

Yikes.

Any resolutions?

Bob

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Error with co_filename when loading modules from zip file Bob <bob@brasko.net> - 2012-03-05 15:36 -0500
  Re: Error with co_filename when loading modules from zip file Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2012-03-05 14:22 -0800
    Re: Error with co_filename when loading modules from zip file Bob Rossi <bob@brasko.net> - 2012-03-05 21:14 -0500
    Re: Error with co_filename when loading modules from zip file Bob Rossi <bob@brasko.net> - 2012-03-05 21:40 -0500
      Re: Error with co_filename when loading modules from zip file Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2012-03-06 02:38 -0800
        Re: Error with co_filename when loading modules from zip file Bob Rossi <bob@brasko.net> - 2012-03-06 08:41 -0500
        Re: Error with co_filename when loading modules from zip file Peter Otten <__peter__@web.de> - 2012-03-06 14:59 +0100

csiph-web