From 73bca86fb30dc22be94b8a68b2195e693d4d8003 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 26 Nov 2025 12:07:29 +0100 Subject: [PATCH] comment / use BS in test --- src/borg/chunkers/reader.pyx | 5 ++++- src/borg/testsuite/chunkers/fixed_test.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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))