Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Error': 0.05; 'computed': 0.07; 'paths': 0.07; 'subject:when': 0.07; 'filename': 0.09; 'subject:modules': 0.09; 'variables,': 0.09; 'stored': 0.13; 'subject:file': 0.13; '.py': 0.16; 'sajip': 0.16; 'vinay': 0.16; 'cc:addr:python-list': 0.16; 'mon,': 0.16; 'url:bugs': 0.17; 'wrote:': 0.18; 'computing': 0.18; 'trace': 0.18; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'stack': 0.24; 'cc:2**0': 0.26; 'function': 0.27; 'tried': 0.27; 'variable': 0.28; 'putting': 0.28; 'cc:addr:python.org': 0.29; 'ran': 0.30; 'file.': 0.31; 'skip:l 30': 0.32; "i've": 0.32; 'header:User- Agent:1': 0.33; 'done': 0.34; 'calling': 0.34; 'frame': 0.34; 'url:python': 0.35; 'two': 0.36; 'received:google.com': 0.37; 'subject:with': 0.37; 'received:209.85': 0.38; 'think': 0.38; 'files': 0.39; 'url:org': 0.39; 'subject:from': 0.39; 'received:209': 0.39; 'might': 0.40; 'header:Received:6': 0.61; 'zip': 0.62; 'darn': 0.84; 'to:addr:yahoo.co.uk': 0.91 Received-SPF: pass (google.com: domain of bob@brasko.net designates 10.68.229.33 as permitted sender) client-ip=10.68.229.33; Authentication-Results: mr.google.com; spf=pass (google.com: domain of bob@brasko.net designates 10.68.229.33 as permitted sender) smtp.mail=bob@brasko.net Date: Mon, 5 Mar 2012 21:40:07 -0500 From: Bob Rossi To: Vinay Sajip Subject: Re: Error with co_filename when loading modules from zip file References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmRxyvAdos3nuoBeU5C5mfi4USVDqy7+BP0OE8FUMBeauP7pwAw6C2ZPmN4oN2436yG9h74 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1331001742 news.xs4all.nl 6965 [2001:888:2000:d::a6]:45988 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21253 On Mon, Mar 05, 2012 at 02:22:55PM -0800, Vinay Sajip wrote: > On Mar 5, 8:36 pm, Bob 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