MCPcopy Index your code
hub / github.com/RustPython/RustPython / _xattrs

Method _xattrs

Lib/pathlib/_os.py:381–391  ·  view source on GitHub ↗

Return the xattrs as a list of (attr, value) pairs, or an empty list if extended attributes aren't supported.

(self, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

379
380 if hasattr(os, 'listxattr'):
381 def _xattrs(self, *, follow_symlinks=True):
382 """Return the xattrs as a list of (attr, value) pairs, or an empty
383 list if extended attributes aren't supported."""
384 try:
385 return [
386 (attr, os.getxattr(self._path, attr, follow_symlinks=follow_symlinks))
387 for attr in os.listxattr(self._path, follow_symlinks=follow_symlinks)]
388 except OSError as err:
389 if err.errno not in (EPERM, ENOTSUP, ENODATA, EINVAL, EACCES):
390 raise
391 return []
392
393
394class _WindowsPathInfo(_PathInfoBase):

Callers 1

copy_infoFunction · 0.80

Calls 2

getxattrMethod · 0.80
listxattrMethod · 0.80

Tested by

no test coverage detected