[Distutils] [Python-Dev] PEP 365 (Adding the pkg_resources module)

Marius Gedminas marius at pov.lt
Wed Mar 19 22:39:08 CET 2008

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

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/distutils-sig/attachments/20080319/9f80cac9/attachment.pgp 

More information about the Distutils-SIG mailing list