bpo-38523: ignore_dangling_symlinks does not apply recursively (GH-22937)

This commit is contained in:
Zackery Spytz 2022-11-07 03:45:16 -08:00 committed by GitHub
parent cfec5b18bf
commit 5ff81da6d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 8 deletions

View file

@ -490,12 +490,13 @@ def _copytree(entries, src, dst, symlinks, ignore, copy_function,
# otherwise let the copy occur. copy2 will raise an error
if srcentry.is_dir():
copytree(srcobj, dstname, symlinks, ignore,
copy_function, dirs_exist_ok=dirs_exist_ok)
copy_function, ignore_dangling_symlinks,
dirs_exist_ok)
else:
copy_function(srcobj, dstname)
elif srcentry.is_dir():
copytree(srcobj, dstname, symlinks, ignore, copy_function,
dirs_exist_ok=dirs_exist_ok)
ignore_dangling_symlinks, dirs_exist_ok)
else:
# Will raise a SpecialFileError for unsupported file types
copy_function(srcobj, dstname)