Skip to content

Commit 3df3b91

Browse files
authored
gh-82814: fix shutil access error on WSL (#103790)
gh-82814: Adds `errno.EACCES` to the list of ignored errors on `_copyxattr`. EPERM and EACCES are different constants but in general should be treated the same. News entry authored by: Gregory P. Smith <[email protected]>
1 parent b51da99 commit 3df3b91

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/shutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def _copyxattr(src, dst, *, follow_symlinks=True):
332332
os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
333333
except OSError as e:
334334
if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA,
335-
errno.EINVAL):
335+
errno.EINVAL, errno.EACCES):
336336
raise
337337
else:
338338
def _copyxattr(*args, **kwargs):
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix a potential ``[Errno 13] Permission denied`` when using :func:`shutil.copystat`
2+
within Windows Subsystem for Linux (WSL) on a mounted filesystem by adding
3+
``errno.EACCES`` to the list of ignored errors within the internal implementation.

0 commit comments

Comments
 (0)