Visitar URL original
Add `_zstd` stdlib module backing `compression.zstd` by JamesClarke7283 · Pull Request #7962 · RustPython/RustPython · GitHub
Skip to content
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9e5c27f
Add _zstd stdlib module backing compression.zstd
JamesClarke7283 May 23, 2026
1def1b4
Fix iOS build by removing static PyMutex<PyTypeRef>
JamesClarke7283 May 23, 2026
ee26123
Fix clippy errors in zstd module
JamesClarke7283 May 23, 2026
fbce9c9
Retrigger CI
JamesClarke7283 May 23, 2026
63103b6
chore: format zstd module
JamesClarke7283 May 23, 2026
77370cb
Update crates/stdlib/src/zstd.rs
JamesClarke7283 May 24, 2026
ace862f
chore: remove rustdoc comments from zstd module
JamesClarke7283 May 24, 2026
07aa356
commit message
JamesClarke7283 May 25, 2026
f7598d6
commit message
JamesClarke7283 May 25, 2026
9b1e29e
Identify zstd parameter enums by type identity, not name
JamesClarke7283 Jun 3, 2026
e6c5b19
Match CPython error behavior in _zstd ZstdCompressor
JamesClarke7283 Jun 3, 2026
dbe4626
Address review: drop decorative separators and unused zstd crate
JamesClarke7283 Aug 9, 2026
9d497f4
Switch _zstd backend from zstd-safe to pure-Rust libzstd-rs-sys
JamesClarke7283 Aug 9, 2026
8fe59b8
Fix data loss in ZstdDecompressor.decompress(max_length=0)
JamesClarke7283 Aug 9, 2026
3d4825e
Drop duplicate spell-checker line in zstd.rs
JamesClarke7283 Aug 9, 2026
52bea59
Address review on _zstd constants, version attrs and dict markers
JamesClarke7283 Aug 19, 2026
1335148
Replace the _zstd flush-mode constants with a CompressMode enum
JamesClarke7283 Aug 19, 2026
68bed04
Correct the _zstd explanatory comments and raise MemoryError on OOM
JamesClarke7283 Aug 19, 2026
e163561
Fix CPython divergences and a crash in the _zstd module
JamesClarke7283 Aug 19, 2026
041f631
Restore Lib/test/test_zstd.py to its vendored CPython state
JamesClarke7283 Aug 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Restore Lib/test/test_zstd.py to its vendored CPython state
The branch dropped the `skipIf(not SUPPORT_MULTITHREADING)` guard from
`test_zstd_multithread_compress`. That guard can never fire against this
backend: libzstd-rs-sys compiles multi-threaded compression in
unconditionally — its Cargo.toml has no `zstdmt`-style feature — so
`CompressionParameter.nb_workers.bounds()` is never `(0, 0)` and
`SUPPORT_MULTITHREADING` is always true.

Removing the decorator therefore changed nothing except to put a
modification of a vendored CPython test in the diff, and it would turn
into a hard failure rather than a skip if a future backend ever lacked
multi-threading. Restore the file so the PR touches no CPython test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
  • Loading branch information
JamesClarke7283 and claude committed Aug 19, 2026
commit 041f631a5e7df668d3a90bbc020a52d04ee85f35
2 changes: 2 additions & 0 deletions Lib/test/test_zstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ def test_unknown_compression_parameter(self):
with self.assertRaisesRegex(ValueError, pattern):
ZstdCompressor(options=option)

@unittest.skipIf(not SUPPORT_MULTITHREADING,
"zstd build doesn't support multi-threaded compression")
def test_zstd_multithread_compress(self):
size = 40*_1M
b = THIS_FILE_BYTES * (size // len(THIS_FILE_BYTES))
Expand Down