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

_virtual_env: handle PermissionError #737

Merged
merged 4 commits into from
Feb 12, 2024
Merged

_virtual_env: handle PermissionError #737

merged 4 commits into from
Feb 12, 2024

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Feb 10, 2024

WIP, needs tests.

Closes #732

See #732

Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw self-assigned this Feb 10, 2024
@woodruffw
Copy link
Member Author

Just thinking out loud: this is going to be really annoying to test. I guess we could mock it out, but that won't guarantee that I got the exact callsite right here.

@woodruffw
Copy link
Member Author

I looked into this a bit more, and I mis-diagnosed this slightly originally: the error here isn't from our own code, but from venv itself: the _setup_pip function uses subprocess internally, which then explodes for the original noexec reason. So current patch is wrong.

Ref: https://github.com/python/cpython/blob/a5f49ce65ef83c41c9cc87566fe59be766d0f3ca/Lib/venv/__init__.py#L357-L360

Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw marked this pull request as ready for review February 12, 2024 18:39
Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw requested a review from di February 12, 2024 18:44
@woodruffw woodruffw merged commit db8b260 into main Feb 12, 2024
7 checks passed
@woodruffw woodruffw deleted the ww/fix-noexec-tmpdir branch February 12, 2024 18:51
@woodruffw woodruffw mentioned this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PermissionError: [Errno 13] Permission denied: '/tmp/tmpzrluurcb/bin/python3'
2 participants