Message365377
Looks like on WSL the errno is errno.EACCES rather than EPERM, so we just need to change the shutil._copyxattr error handler to also cope with that error code:
except OSError as e:
- if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA):
+ if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA, errno.EACCES):
raise
If anyone needs a workaround until this is fixed in shutil itself, you can do it by monkey-patching _copyxattr:
import errno, shutil
# have to monkey patch to work with WSL as workaround for https://bugs.python.org/issue38633
orig_copyxattr = shutil._copyxattr
def patched_copyxattr(src, dst, *, follow_symlinks=True):
try:
orig_copyxattr(src, dst, follow_symlinks=follow_symlinks)
except OSError as ex:
if ex.errno != errno.EACCES: raise
shutil._copyxattr = patched_copyxattr |
|
Date |
User |
Action |
Args |
2020-03-31 11:31:03 | benspiller | set | recipients:
+ benspiller, paul.moore, tim.golden, zach.ware, steve.dower, pspeter |
2020-03-31 11:31:03 | benspiller | set | messageid: <1585654263.58.0.972032936505.issue38633@roundup.psfhosted.org> |
2020-03-31 11:31:03 | benspiller | link | issue38633 messages |
2020-03-31 11:31:03 | benspiller | create | |
|