Fix wheel file permissions being too restrictive - #806
Open
pctablet505 wants to merge 2 commits into
Open
Conversation
pctablet505
marked this pull request as ready for review
July 17, 2026 12:26
make_wheel_in() builds the wheel in a temporary file created by tempfile.mkstemp(), which sets permissions to 0600. This mode was never relaxed before the file was renamed into place, so built wheels ended up mode 0600 instead of a normal, world-readable 0644. Normalize the temp file's permissions with the existing normalize_file_permissions() helper before renaming it to the final wheel path, matching how files inside the wheel are already normalized. Fixes pypa#804
Add a Version 4.0.1 heading with a release-notes bullet for the wheel permissions fix, following the project's convention of giving each bugfix a :ghpull: reference under its own version heading.
pctablet505
force-pushed
the
fix-wheel-permissions-804
branch
from
August 16, 2026 02:56
706e284 to
15bc930
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #804
make_wheel_in()builds the wheel in a temporary file created bytempfile.mkstemp(), which sets the file's permissions to0600. That mode was never relaxed before the temp file was renamed into its final.whlpath, so built wheels ended up owner-only readable instead of the usual world-readable0644. This breaks setups where the wheel is later read by a different user (e.g. some CI/build pipelines).The fix normalizes the temp file's permissions with the existing
normalize_file_permissions()helper right before it's renamed into place, matching the same normalization already applied to the entries inside the wheel. Added a regression test that checks the built wheel's mode on disk.Same root cause as pypa/hatch#1519, fixed there with the analogous
normalize_artifact_permissions().