diff --git a/tests/rust-python-harness/strategies/e2e_benchmark/worker.py b/tests/rust-python-harness/strategies/e2e_benchmark/worker.py index 89c5d1cd896..201a2c6339e 100644 --- a/tests/rust-python-harness/strategies/e2e_benchmark/worker.py +++ b/tests/rust-python-harness/strategies/e2e_benchmark/worker.py @@ -17,8 +17,11 @@ from .models import Invocation, Ready, Timing def file_sha256(path: Path) -> str: + digest: Final = hashlib.sha256() with path.open("rb") as source: - return hashlib.file_digest(source, "sha256").hexdigest() + for chunk in iter(lambda: source.read(256 * 1024), b""): + digest.update(chunk) + return digest.hexdigest() def _ready(response: OCRResponse) -> Ready: