diff --git a/src/borg/chunkers/reader.pyx b/src/borg/chunkers/reader.pyx index d33917a3a..115281d42 100644 --- a/src/borg/chunkers/reader.pyx +++ b/src/borg/chunkers/reader.pyx @@ -138,7 +138,10 @@ class FileFMAPReader: try: fmap = list(sparsemap(self.fd, self.fh)) except (OSError, ValueError) as err: - # seeking did not work + # Building a sparse map failed: + # - OSError: low-level lseek with SEEK_HOLE/SEEK_DATA not supported by FS/OS. + # - ValueError: high-level file objects (e.g. io.BytesIO or some fd wrappers) + # don't accept SEEK_HOLE/SEEK_DATA as a valid "whence" and raise ValueError. pass if fmap is None: diff --git a/src/borg/testsuite/chunkers/fixed_test.py b/src/borg/testsuite/chunkers/fixed_test.py index 8fac894f1..80782d4d0 100644 --- a/src/borg/testsuite/chunkers/fixed_test.py +++ b/src/borg/testsuite/chunkers/fixed_test.py @@ -34,7 +34,7 @@ from ...constants import * # NOQA ) def test_chunkify_sparse(tmpdir, fname, sparse_map, header_size, sparse): def get_chunks(fname, sparse, header_size): - chunker = ChunkerFixed(4096, header_size=header_size, sparse=sparse) + chunker = ChunkerFixed(BS, header_size=header_size, sparse=sparse) with open(fname, "rb") as fd: return cf(chunker.chunkify(fd))