stage.steal_source: preserve symlinks

This avoids dangling symlink errors. ignore_dangling_symlinks option would be more-targeted but is only available for Python >= 3.2 (#28318)
This commit is contained in:
Peter Scheibel 2022-01-10 10:10:49 -08:00 committed by GitHub
parent cc32b08205
commit 9f7fb6d01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -543,7 +543,7 @@ def steal_source(self, dest):
for entry in hidden_entries + entries:
if os.path.isdir(entry):
d = os.path.join(dest, os.path.basename(entry))
shutil.copytree(entry, d)
shutil.copytree(entry, d, symlinks=True)
else:
shutil.copy2(entry, dest)