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.

Aside: I never understood the reason for storing the value of __file__
in the .pyc/.pyo file itself.  Why not set it to the correct value on
import time?

Marius Gedminas
-- 
If you have to run heating in winter, you don't own enough computers.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to