Skip to content

gh-127172: Honor umask and default ACL when installing venv activation scripts - #154850

Open
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:venv-honor-umask-acl
Open

gh-127172: Honor umask and default ACL when installing venv activation scripts#154850
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:venv-honor-umask-acl

Conversation

@tonghuaroot

@tonghuaroot tonghuaroot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

venv installs the activation scripts (activate, activate.csh,
activate.fish) by copying the packaged template's mode onto the output, so
they always end up 0644 regardless of the process umask or any default ACL on
the target directory. Every other file venv creates (the pip wrappers, and
any file written afterwards) honors the umask and ACL, so the activation scripts
are the odd ones out: on a directory with a group-writable default ACL they come
out rw-r--r-- while pip* come out rw-rw-rw-.

Activation scripts are sourced, not executed, so they need no special mode. This
drops the mode-copying in install_scripts so the scripts inherit the umask and
default ACL like everything else venv writes.

The added regression test drives the process umask, so it needs no ACL support
and runs on every POSIX platform.

…ivation scripts

venv wrote the activation scripts with a fixed mode copied from the packaged
templates, so they ignored the process umask and any default ACL, unlike every
other file venv creates. Copy only the data and let the new files inherit the
umask and ACL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant