bpo-24538: Fix bug in shutil involving the copying of xattrs to read-only files. (PR-13212)
Extended attributes can only be set on user-writeable files, but shutil previously
first chmod()ed the destination file to the source's permissions and then tried to
copy xattrs. This will cause failures if attempting to copy read-only files with
xattrs, as occurs with Git clones on Lustre FS.
diff --git a/Misc/ACKS b/Misc/ACKS
index 300e788..dfb9637 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -149,6 +149,7 @@
Ron Bickers
Natalia B. Bidart
Adrian von Bidder
+Olexa Bilaniuk
David Binger
Dominic Binks
Philippe Biondi
diff --git a/Misc/NEWS.d/next/Library/2019-05-09-08-35-18.bpo-24538.WK8Y-k.rst b/Misc/NEWS.d/next/Library/2019-05-09-08-35-18.bpo-24538.WK8Y-k.rst
new file mode 100644
index 0000000..e799f93
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-05-09-08-35-18.bpo-24538.WK8Y-k.rst
@@ -0,0 +1,3 @@
+In `shutil.copystat()`, first copy extended file attributes and then file
+permissions, since extended attributes can only be set on the destination
+while it is still writeable.