diff --git a/CHANGELOG.md b/CHANGELOG.md index b638418..c916d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## Unreleased + +- Fix `SeekableZstdFile` write table entries on 32-bits architectures when there is a huge number of entries + ## 0.19.0 (November 7, 2025) - The project has been completely refactored to use the Zstandard implementation from the standard library ([PEP-784](https://peps.python.org/pep-0784/)) diff --git a/src/pyzstd/_seekable_zstdfile.py b/src/pyzstd/_seekable_zstdfile.py index c91fffc..029ff93 100644 --- a/src/pyzstd/_seekable_zstdfile.py +++ b/src/pyzstd/_seekable_zstdfile.py @@ -305,8 +305,9 @@ def write_seek_table(self, fp: BinaryIO) -> None: self._s_2uint32.pack_into(ba, offset, 0x184D2A5E, size - 8) offset += 8 # Entries - for i in range(0, len(self._frames), 2): - self._s_2uint32.pack_into(ba, offset, self._frames[i], self._frames[i + 1]) + iter_frames = iter(self._frames) + for frame_c, frame_d in zip(iter_frames, iter_frames, strict=True): + self._s_2uint32.pack_into(ba, offset, frame_c, frame_d) offset += 8 # Footer self._s_footer.pack_into(ba, offset, self._frames_count, 0, 0x8F92EAB1)