[Python-checkins] (no subject)

Łukasz Langa webhook-mailer at python.org
Thu Aug 29 17:51:24 EDT 2019




To: python-checkins at python.org
Subject: [3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

https://github.com/python/cpython/commit/25a044ee6ce50a9172478cc61d9146447784=
55f6
commit: 25a044ee6ce50a9172478cc61d914644778455f6
branch: 3.8
author: =C5=81ukasz Langa <lukasz at langa.pl>
committer: GitHub <noreply at github.com>
date: 2019-08-29T23:51:19+02:00
summary:

[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 at python.org>

files:
A Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
M Lib/shutil.py

diff --git a/Lib/shutil.py b/Lib/shutil.py
index 39f793b5f3bd..561ad71508cc 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -544,7 +544,7 @@ def copytree(src, dst, symlinks=3DFalse, ignore=3DNone, c=
opy_function=3Dcopy2,
                          ignore_dangling_symlinks=3Dignore_dangling_symlinks,
                          dirs_exist_ok=3Ddirs_exist_ok)
=20
-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.rs=
t b/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
new file mode 100644
index 000000000000..afbbb3313a5b
--- /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.



More information about the Python-checkins mailing list