From f22337d7de3285bedc4acd988196ccbd1bdce810 Mon Sep 17 00:00:00 2001 From: Wim Glenn Date: Thu, 19 Dec 2024 16:18:56 -0600 Subject: [PATCH 1/2] Prevent copying extended attributes of script files when creating a venv. --- Lib/venv/__init__.py | 9 +++------ .../2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index dc4c9ef3531991..ea9dc12aad6d0a 100644 --- a/Lib/venv/__init__.py +++ b/Lib/venv/__init__.py @@ -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( diff --git a/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst b/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst new file mode 100644 index 00000000000000..e6252e8ee0fc20 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst @@ -0,0 +1 @@ +Prevent copying extended attributes of script files when creating a venv. From a7a6b151cd5f701fed3e8c1f39579a8090d5ca53 Mon Sep 17 00:00:00 2001 From: Wim Jeantine-Glenn Date: Thu, 9 Jan 2025 22:51:16 -0600 Subject: [PATCH 2/2] Update Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst Co-authored-by: Peter Bierma --- .../next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst b/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst index e6252e8ee0fc20..fb632b0e3608c9 100644 --- a/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst +++ b/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst @@ -1 +1 @@ -Prevent copying extended attributes of script files when creating a venv. +Fix ``No space left on device`` error emitted by :mod:`venv` when on a filesystem that contains large extended attributes.