On Wed, Mar 19, 2008 at 03:58:58PM -0400, Jim Fulton wrote: > On Mar 19, 2008, at 3:52 PM, Marius Gedminas wrote: > >On Wed, Mar 19, 2008 at 03:37:59PM -0400, Jim Fulton wrote: > >>On Mar 18, 2008, at 2:51 PM, Marius Gedminas wrote: > >>... > >>>os.path.join(os.path.dirname(__file__), 'foo') just has too many > >>>problems. > >> > >>Could you be specific? > > > >I suppose I was thinking about the stale .pyc file problem, mostly. > > > >zc.buildout/setuptools/distutils (I'm not sure which part of the stack > >is to blame) likes to compile modules in a temporary directory and > >then > >move the .py and .pyc files to their final location. As a result, > >__file__ points to the now-nonexistent directory. > > You are mistaken. The file information in the code object is wrong, > which is wildly annoying when looking at traceback or using pdb, but > __file__ is correct.
Oops, you're right. My brain stopped working (which often happens lately, just about when I decide to write an email or comment in a bug tracker. Late evenings and lack of sleep may have something to do with it.). I retract my statement. The only problem with os.path.join(os.path.dirname(__file__), 'foo') is that it's long and cumbersome to type (and doesn't work in zip files, but I don't much care about those). Marius Gedminas -- If it weren't for the last minute, nothing would get done.
signature.asc
Description: Digital signature
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig