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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Lib/venv/__init__.py
937C
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,9 @@ def skip_file(f):
logger.warning('unable to copy script %r, '
'may be binary: %s', srcfile, e)
continue
if new_data == data:
shutil.copy2(srcfile, dstfile)
else:
with open(dstfile, 'wb') as f:
f.write(new_data)
shutil.copymode(srcfile, dstfile)
with open(dstfile, 'wb') as f:
f.write(new_data)
shutil.copymode(srcfile, dstfile)

def upgrade_dependencies(self, context):
logger.debug(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``No space left on device`` error emitted by :mod:`venv` when on a filesystem that contains large extended attributes.
Loading
0