After "make install" the __pycache__ directories are only readable by root
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the RHEL9 build using the configure, make, and sudo make install commands in the report, then trace how installation creates the pycache directories and files. Done means a non-root user can read the installed pycache directories and .pyc files without the manual chmod workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100