This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benspiller
Recipients benspiller, paul.moore, pspeter, steve.dower, tim.golden, zach.ware
Date 2020-03-31.11:31:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585654263.58.0.972032936505.issue38633@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-03-31 11:31:03benspillersetrecipients: + benspiller, paul.moore, tim.golden, zach.ware, steve.dower, pspeter
2020-03-31 11:31:03benspillersetmessageid: <1585654263.58.0.972032936505.issue38633@roundup.psfhosted.org>
2020-03-31 11:31:03benspillerlinkissue38633 messages
2020-03-31 11:31:03benspillercreate