On Mar 22, 2010, at 12:38 PM, Guido van Rossum wrote:

>Huh? Last time I looked weren't we going to make __pycache__ the
>default (and eventually only) behavior?

We definitely agreed it would be the default in Python 3.2.

My recollection is that we agreed it would be the only on-demand way of
writing pyc files, but that Python would read a lone .pyc file where the
source would be if the source is missing, and that py_compile/compileall would
support optional creation of those lone .pyc files.

>I see only two reasonable solutions for __pycache__ creation -- either
>we change all setup/install scripts (both for core Python and for 3rd
>party packages) to always create a __pycache__ subdirectory for every
>directory (including package directories) installed; or we somehow
>create it the first time it's needed.
>
>But creating it as needed runs into at least similar problems with
>ownership as creating .pyc files when first needed (if the parent
>directory is root-owned a mere mortal can't create it at all). So even
>apart from the security issue (which I haven't thought about deeply) I
>think precreation should at least be an easily accessible option both
>for the core (where it can be done by compileall) and for 3rd party
>packages (where I guess it's up to distutils or whatever install
>mechanism is used).

So you're +1 on Tough Luck?  I think that's the best answer.  You will be able
to arrange pre-creation though compileall with the right layout and presumably
the right umask if you want.

-Barry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to