Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 'pip install' for zips with bunk permissions #1757

Merged
merged 3 commits into from
Feb 20, 2024
Merged

Conversation

BurntSushi
Copy link
Member

This fixes an issue where installing a source dist from a zip file could
fail if the permissions in the zip file were bunk. Namely, after extracting
a zip file, we go through each record and set the permissions on each file
based on the permissions recorded in the zip file. But apparently, those
permissions are sometimes present but 0, which in turn caused us to set the
permissions to 0 on files and thus prevent our access to them.

We fix this by treating "absent permissions" and "permissions of mode 0" as the
same thing.

Fixes #1453

@BurntSushi
Copy link
Member Author

This fix is actually duplicative with #1743, which also fixes #1453 (but in a better way). So I removed the "fix" from this PR, but kept the regression test and a couple other small fixups. Once #1743 is merged, we should be able to bring this one in. (CI for this branch will fail on the regression test until then.)

@BurntSushi BurntSushi added the internal A refactor or improvement that is not user-facing label Feb 20, 2024
A WARN log was being emitted for a "broken cache entry" in the case
where the cache entry simply doesn't exist. But this is totally fine and
expected. So we detect the kind of error that occurred and emit a TRACE
if the file simply didn't exist.
This is just a style thing.
This ensures we can install a source dist from a `zip`
file that has present but bunk permissions.

Fixes #1453
@BurntSushi BurntSushi merged commit 8bcb998 into main Feb 20, 2024
7 checks passed
@BurntSushi BurntSushi deleted the ag/fix-1453 branch February 20, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing from a github zip archive extracts files with zero permissions.
1 participant