Merge pull request #9231 from ThomasWaldmann/enoattr
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled

move ENOATTR to borg.platform
This commit is contained in:
TW 2025-12-20 19:30:07 +01:00 committed by GitHub
commit a0e250df0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 11 deletions

View file

@ -12,7 +12,7 @@ from signal import SIGINT
from .constants import ROBJ_FILE_STREAM, zeros
from .fuse_impl import llfuse, has_pyfuse3
from .platform import ENOATTR
if has_pyfuse3:
import trio
@ -638,7 +638,7 @@ class FuseOperations(llfuse.Operations, FuseBackend):
try:
return item.get("xattrs", {})[name] or b""
except KeyError:
raise llfuse.FUSEError(llfuse.ENOATTR) from None
raise llfuse.FUSEError(ENOATTR) from None
@async_wrapper
def lookup(self, parent_inode, name, ctx=None):

View file

@ -24,7 +24,11 @@ API_VERSION = "1.2_05"
fdatasync = getattr(os, "fdatasync", os.fsync)
has_posix_fadvise = hasattr(os, "posix_fadvise")
from .xattr import ENOATTR
try:
ENOATTR = errno.ENOATTR # type: ignore[attr-defined]
except AttributeError:
# on some platforms, ENOATTR is missing, use ENODATA there
ENOATTR = errno.ENODATA # type: ignore[attr-defined]
def listxattr(path, *, follow_symlinks=False):

View file

@ -4,13 +4,6 @@ import os
from ..helpers import Buffer
try:
ENOATTR = errno.ENOATTR # type: ignore[attr-defined]
except AttributeError:
# on some platforms, ENOATTR is missing, use ENODATA there
ENOATTR = errno.ENODATA # type: ignore[attr-defined]
buffer = Buffer(bytearray, limit=2**24)

View file

@ -7,6 +7,7 @@ import pytest
from ... import xattr, platform
from ...constants import * # NOQA
from ...platform import ENOATTR
from ...storelocking import Lock
from ...helpers import flags_noatime, flags_normal
from .. import has_lchflags, llfuse
@ -155,7 +156,7 @@ def test_fuse(archivers, request):
try:
xattr.getxattr(out_fn, b"user.foo")
except OSError as e:
assert e.errno == llfuse.ENOATTR
assert e.errno == ENOATTR
else:
assert False, "expected OSError(ENOATTR), but no error was raised"
except OSError as err: