Author Anthony Sottile
Recipients Anthony Sottile
Date 2017-11-04.00:14:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509754489.15.0.213398074469.issue31940@psf.upfronthosting.co.za>
In-reply-to
Content
Here's one idea for a patch (inspired by the rest of the function):

```
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 464ee91..2099289 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -213,6 +213,13 @@ def copystat(src, dst, *, follow_symlinks=True):
         # symlink.  give up, suppress the error.
         # (which is what shutil always did in this circumstance.)
         pass
+    except OSError as why:
+        # lchmod on alpine will raise this with symlinks: #31940
+        for err in 'EOPNOTSUPP', 'ENOTSUP':
+            if hasattr(errno, err) and why.errno == getattr(errno, err):
+                break
+        else:
+            raise
     if hasattr(st, 'st_flags'):
         try:
             lookup("chflags")(dst, st.st_flags, follow_symlinks=follow)
```

However lchmod seems to be just broken on alpine so the tests continue to fail (however my usecase is fixed)
History
Date User Action Args
2017-11-04 00:14:49Anthony Sottilesetrecipients: + Anthony Sottile
2017-11-04 00:14:49Anthony Sottilesetmessageid: <1509754489.15.0.213398074469.issue31940@psf.upfronthosting.co.za>
2017-11-04 00:14:49Anthony Sottilelinkissue31940 messages
2017-11-04 00:14:49Anthony Sottilecreate