From d02db2cc768540dfbba183b04f2985a844d1affc Mon Sep 17 00:00:00 2001 From: Allan Lago Date: Mon, 24 Apr 2023 14:55:24 -0400 Subject: [PATCH 1/3] fix shutil access error on WSL --- Lib/shutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/shutil.py b/Lib/shutil.py index c75ea4da02ebb4..7d1a3d00011f37 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -332,7 +332,7 @@ def _copyxattr(src, dst, *, follow_symlinks=True): os.setxattr(dst, name, value, follow_symlinks=follow_symlinks) except OSError as e: if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA, - errno.EINVAL): + errno.EINVAL, errno.EACCES): raise else: def _copyxattr(*args, **kwargs): From 9d0f6ed4235d7760050fa8a4fb97218b73650d33 Mon Sep 17 00:00:00 2001 From: Allan Lago Date: Mon, 24 Apr 2023 15:51:45 -0400 Subject: [PATCH 2/3] add news --- .../next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst diff --git a/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst b/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst new file mode 100644 index 00000000000000..b7dca24d7cdb0f --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst @@ -0,0 +1,2 @@ +Avoid WSL access issues by adding errno.EACCES to list of ignored errors in +shutil._copyxattr From 00f266f07b1090e408af16f3d28ac74350bc7cd7 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 24 Apr 2023 14:50:55 -0700 Subject: [PATCH 3/3] Reword and ReSTify the NEWS entry. this mentions the actual function who's behavior is improved and avoids mentioning the specific internal implementation detail function name. it also applies ReST formatting. --- .../Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst b/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst index b7dca24d7cdb0f..5bd005ffacb800 100644 --- a/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst +++ b/Misc/NEWS.d/next/Windows/2023-04-24-15-51-11.gh-issue-82814.GI3UkZ.rst @@ -1,2 +1,3 @@ -Avoid WSL access issues by adding errno.EACCES to list of ignored errors in -shutil._copyxattr +Fix a potential ``[Errno 13] Permission denied`` when using :func:`shutil.copystat` +within Windows Subsystem for Linux (WSL) on a mounted filesystem by adding +``errno.EACCES`` to the list of ignored errors within the internal implementation.