8000 gh-127638: Prevent copying extended attributes of script files when creating venv by wimglenn · Pull Request #128105 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127638: Prevent copying extended attributes of script files when creating venv #128105

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

wimglenn
Copy link
Contributor
@wimglenn wimglenn commented Dec 19, 2024

Prevent the regression in Python 3.13 on Linux when creating a venv from interpreter hosted on large xattr filesystem.

There are a few other copy2 usages in venv/__init__.py but they are all gated by conditions on os.name == 'nt' so don't affect Linux.

Instead of handling the possible error from the copy (which looks like: shutil.copy2 -> copystat -> _copyattr -> os.setxattr -> OSError: [Errno 28] No space left on device) I've opted to just remove that conditional. I don't think we want to have attrs or not based on whether new_data == data, rather we want them always there or not regardless of file content.

@ZeroIntensity ZeroIntensity added topic-venv Related to the venv module needs backport to 3.13 bugs and security fixes labels Jan 10, 2025
Copy link
Member
@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @zooba as the author of the regressing PR (#113129)

@zooba
Copy link
Member
zooba commented Jan 14, 2025

Why Linux can't copy files properly is out of my depth 😆 If this fixes it, sure.

@vsajip likes to look in on venv changes.

@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes topic-venv Related to the venv module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0