mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-13 10:50:21 -04:00
Fix Python 3.2 issue on FreeBSD
This commit is contained in:
parent
88618e4132
commit
df5e4a52a6
3 changed files with 10 additions and 9 deletions
|
|
@ -349,12 +349,9 @@ class Archive(object):
|
|||
}
|
||||
if self.numeric_owner:
|
||||
item[b'user'] = item[b'group'] = None
|
||||
try:
|
||||
xattrs = xattr.get_all(path, follow_symlinks=False)
|
||||
if xattrs:
|
||||
item[b'xattrs'] = xattrs
|
||||
except PermissionError:
|
||||
pass
|
||||
xattrs = xattr.get_all(path, follow_symlinks=False)
|
||||
if xattrs:
|
||||
item[b'xattrs'] = xattrs
|
||||
return item
|
||||
|
||||
def process_item(self, path, st):
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from attic.xattr import get_all
|
|||
if 'HAVE_FUTIMENS' in getattr(posix, '_have_functions', []):
|
||||
st_mtime_ns_round = 0
|
||||
elif 'HAVE_UTIMES' in sysconfig.get_config_vars():
|
||||
st_mtime_ns_round = -4
|
||||
st_mtime_ns_round = -6
|
||||
else:
|
||||
st_mtime_ns_round = -9
|
||||
|
||||
|
|
|
|||
|
|
@ -211,8 +211,12 @@ except ImportError:
|
|||
names = []
|
||||
mv = memoryview(namebuf.raw)
|
||||
while mv:
|
||||
names.append(os.fsdecode(bytes(mv[1:1+mv[0]])))
|
||||
mv = mv[1+mv[0]:]
|
||||
length = mv[0]
|
||||
# Python < 3.3 returns bytes instead of int
|
||||
if isinstance(length, bytes):
|
||||
length = ord(length)
|
||||
names.append(os.fsdecode(bytes(mv[1:1+length])))
|
||||
mv = mv[1+length:]
|
||||
return names
|
||||
|
||||
def getxattr(path, name, *, follow_symlinks=True):
|
||||
|
|
|
|||
Loading…
Reference in a new issue