Anthony Sottile <asott...@umich.edu> added the comment: 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) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31940> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com