[Python-Dev] Unexpected behaviour in compileall (original) (raw)

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Nov 2 12:37:52 CET 2011


I just started getting errors in my PEP 404 / pythonv branch, but they don't at first glance appear related to the functionality of this branch. What I'm seeing is that during installation, some of the .pyc/.pyo files written by compileall have mode 600 rather than the expected 644, with the result that test_compileall fails when run from the installed Python as an unprivileged user. If I manually do

sudo chmod a+r /usr/local/lib/python3.3/pycache/*

then test_compileall works again.

I added a diagnostic to compileall.py, here's an extract from the log of the subsequent installation:

Listing '/usr/local/lib/python3.3'... Compiling '/usr/local/lib/python3.3/future.py'... Mode of [...]/pycache/future.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/phello.foo.py'... Mode of [...]/pycache/phello.foo.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_compat_pickle.py'... Mode of [...]/pycache/_compat_pickle.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_dummy_thread.py'... Mode of [...]/pycache/_dummy_thread.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_markupbase.py'... Mode of [...]/pycache/_markupbase.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_pyio.py'... Mode of [...]/pycache/_pyio.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_strptime.py'... Mode of [...]/pycache/_strptime.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_sysconfigdata.py'... Mode of [...]/pycache/_sysconfigdata.cpython-33.pyc is 600 Compiling '/usr/local/lib/python3.3/_threading_local.py'... Mode of [...]/pycache/_threading_local.cpython-33.pyc is 644 Compiling '/usr/local/lib/python3.3/_weakrefset.py'... Mode of [...]/pycache/_weakrefset.cpython-33.pyc is 600 Compiling '/usr/local/lib/python3.3/abc.py'... Mode of [...]/pycache/abc.cpython-33.pyc is 600 Compiling '/usr/local/lib/python3.3/aifc.py'... Mode of [...]/pycache/aifc.cpython-33.pyc is 644

The 600s and 644s are interspersed with no pattern immediately apparent. All the source files have mode 644, as expected.

This happens on two different Posix machines - Ubuntu Natty and OS X Leopard

Can anyone shed any light as to what might be going on?

Regards,

Vinay Sajip



More information about the Python-Dev mailing list