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..fb632b0e3608c9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-12-19-16-17-56.gh-issue-127638.Km-VEi.rst @@ -0,0 +1 @@ +Fix ``No space left on device`` error emitted by :mod:`venv` when on a filesystem that contains large extended attributes.