Skip to content

Commit 3c61348

Browse files
committed
fix: SeekableZstdFile: write table on on 32bits
1 parent d3ba90e commit 3c61348

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## Unreleased
6+
7+
- Fix `SeekableZstdFile` write table entries on 32-bits architectures when there is a huge number of entries
8+
59
## 0.19.0 (November 7, 2025)
610

711
- The project has been completely refactored to use the Zstandard implementation from the standard library ([PEP-784](https://peps.python.org/pep-0784/))

src/pyzstd/_seekable_zstdfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,9 @@ def write_seek_table(self, fp: BinaryIO) -> None:
305305
self._s_2uint32.pack_into(ba, offset, 0x184D2A5E, size - 8)
306306
offset += 8
307307
# Entries
308-
for i in range(0, len(self._frames), 2):
309-
self._s_2uint32.pack_into(ba, offset, self._frames[i], self._frames[i + 1])
308+
iter_frames = iter(self._frames)
309+
for frame_c, frame_d in zip(iter_frames, iter_frames, strict=True):
310+
self._s_2uint32.pack_into(ba, offset, frame_c, frame_d)
310311
offset += 8
311312
# Footer
312313
self._s_footer.pack_into(ba, offset, self._frames_count, 0, 0x8F92EAB1)

0 commit comments

Comments
 (0)