[Python-Dev] PEP 3147, pycache directories and umask (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 23 23:37:12 CET 2010


Russell E. Owen wrote:

If .pyc files are to be shared, it seems essential to (by default) generate them at install time and make them read-only for unprivileged users.

This in turn implies that we may have to give up some support for dragging python modules into site-packages

No, I don't think so. Currently, when you install a package (by whatever means) in a directory that's not writable by the people who will be running it, there are two possibilities:

  1. Precompiled .pyc files are generated at installation time, which are then read-only to users.

  2. No .pyc files are installed, in which case none can or will be created by users either, since they don't have write permission to the directory.

None of this would change if pycache directories were used. The only difference would be that there would be an additional mode for failure to create .pyc files, i.e. pycache could be created but nothing could be written to it because of a umask issue.

If you install in a shared site-packages by dragging, you already have to be careful about setting the permissions. You'd just have to be sure to extended that diligence to any contained pycache directories.

-- Greg



More information about the Python-Dev mailing list