summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2019-08-29 21:51:19 (GMT)
committerGitHub <noreply@github.com>2019-08-29 21:51:19 (GMT)
commit25a044ee6ce50a9172478cc61d914644778455f6 (patch)
treeca71c7486ab9a2b80575543c8fbcd540b535d5dd
parent96631dcb11c2786f470d4586bf23ecca14361506 (diff)
downloadcpython-25a044ee6ce50a9172478cc61d914644778455f6.zip
cpython-25a044ee6ce50a9172478cc61d914644778455f6.tar.gz
cpython-25a044ee6ce50a9172478cc61d914644778455f6.tar.bz2
[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 7fcc2088a50a4ecb80e5644cd195bee209c9f979) Co-authored-by: Ned Deily <nad@python.org>
-rw-r--r--Lib/shutil.py2
-rw-r--r--Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst2
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 39f793b..561ad71 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -544,7 +544,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
ignore_dangling_symlinks=ignore_dangling_symlinks,
dirs_exist_ok=dirs_exist_ok)
-if hasattr(stat, 'FILE_ATTRIBUTE_REPARSE_POINT'):
+if hasattr(os.stat_result, 'st_file_attributes'):
# Special handling for directory junctions to make them behave like
# symlinks for shutil.rmtree, since in general they do not appear as
# regular links.
diff --git a/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst b/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
new file mode 100644
index 0000000..afbbb33
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
@@ -0,0 +1,2 @@
+Prevent shutil.rmtree exception when built on non-Windows system without fd
+system call support, like older versions of macOS.