diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 5747ed612..137701264 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -625,7 +625,7 @@ def _process(self, *, path, parent_fd=None, name=None, with backup_io('scandir'): entries = helpers.scandir_inorder(path=path, fd=child_fd) for dirent in entries: - normpath = os.path.normpath(dirent.path) + normpath = os.path.normpath(os.path.join(path, dirent.name)) self._process(path=normpath, parent_fd=child_fd, name=dirent.name, fso=fso, cache=cache, matcher=matcher, exclude_caches=exclude_caches, exclude_if_present=exclude_if_present, diff --git a/src/borg/helpers/fs.py b/src/borg/helpers/fs.py index 6c9d9556f..24c525d25 100644 --- a/src/borg/helpers/fs.py +++ b/src/borg/helpers/fs.py @@ -149,7 +149,7 @@ def scandir_keyfunc(dirent): def scandir_inorder(*, path, fd=None): - # py37+ supports giving a fd instead of a path + # py37+ supports giving an fd instead of a path (no full entry.path in DirEntry in that case!) arg = fd if fd is not None and py_37_plus else path return sorted(os.scandir(arg), key=scandir_keyfunc)