mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
#17076: Make copying of xattrs more permissive of missing FS support
Patch by Thomas Wouters.
This commit is contained in:
commit
4cd7b9c3e9
3 changed files with 21 additions and 1 deletions
|
@ -140,7 +140,13 @@ if hasattr(os, 'listxattr'):
|
|||
|
||||
"""
|
||||
|
||||
for name in os.listxattr(src, follow_symlinks=follow_symlinks):
|
||||
try:
|
||||
names = os.listxattr(src, follow_symlinks=follow_symlinks)
|
||||
except OSError as e:
|
||||
if e.errno not in (errno.ENOTSUP, errno.ENODATA):
|
||||
raise
|
||||
return
|
||||
for name in names:
|
||||
try:
|
||||
value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
|
||||
os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue