Skip to content

After "make install" the __pycache__ directories are only readable by rootΒ #126086

@harri-pasanen

Description

@harri-pasanen

Bug report

Bug description:

Building python on RHEL9 with

mkdir tmp; export TMPDIR=$(pwd)/tmp
tar xf /tmp/Python-3.11.10.tar.xz
cd Python-3.11.10/
./configure --enable-optimizations --with-lto
make -s -j
sudo make install

results in a usable python. However only root can read the __pycache__ files, example:

ls -l /usr/local/lib/python3.11/__pycache__

...
-rw-r-----. 1 root root 29675 Oct 28 18:26 zipimport.cpython-311.opt-1.pyc
-rw-r-----. 1 root root 25988 Oct 28 18:26 zipimport.cpython-311.opt-2.pyc
-rw-r-----. 1 root root 29793 Oct 28 18:26 zipimport.cpython-311.pyc

Note that the pycache folder itself is also only readable by root.

To fix this manually one can do

sudo find /usr/local -type d -name '__pycache__' -exec chmod -R a+rX {} \;

but I would have expected make install to do it.

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtopic-installationtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions