8000 [3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603) · python/cpython@25a044e · GitHub
[go: up one dir, main page]

Skip to content

Commit 25a044e

Browse files
ambvned-deily
andauthored
[3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)
when built on non-Windows system without fd system call support, like older versions of macOS. (cherry picked from commit 7fcc208) Co-authored-by: Ned Deily <nad@python.org>
1 parent 96631dc commit 25a044e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/shutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
544544
ignore_dangling_symlinks=ignore_dangling_symlinks,
545545
dirs_exist_ok=dirs_exist_ok)
546546

547-
if hasattr(stat, 'FILE_ATTRIBUTE_REPARSE_POINT'):
547+
if hasattr(os.stat_result, 'st_file_attributes'):
548548
# Special handling for directory junctions to make them behave like
549549
# symlinks for shutil.rmtree, since in general they do not appear as
550550
# regular links.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Prevent shutil.rmtree exception when built on non-Windows system without fd
2+
system call support, like older versions of macOS.

0 commit comments

Comments
 (0)
0