]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-150583: Fix zstd compression level with digested ZstdDict (GH-150586) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 18 Jul 2026 07:21:46 +0000 (09:21 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Jul 2026 07:21:46 +0000 (00:21 -0700)
gh-150583: Fix zstd compression level with digested ZstdDict (GH-150586)
(cherry picked from commit 0983642c966d9c536416101e99b7d2b085483847)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
Misc/NEWS.d/next/Library/2026-06-03-19-35-32.gh-issue-150583.dedI24.rst [new file with mode: 0644]
Modules/_zstd/compressor.c

diff --git a/Misc/NEWS.d/next/Library/2026-06-03-19-35-32.gh-issue-150583.dedI24.rst b/Misc/NEWS.d/next/Library/2026-06-03-19-35-32.gh-issue-150583.dedI24.rst
new file mode 100644 (file)
index 0000000..edb551b
--- /dev/null
@@ -0,0 +1,2 @@
+Correctly set the default compression level in :mod:`compression.zstd` when passing a digested
+dictionary during compression.
index b2eb22d9ec8add8082e63da4042d007cac593d5d..894568fce28d0d5436ac2765b8b6c11a152cb43e 100644 (file)
@@ -347,6 +347,7 @@ _zstd_ZstdCompressor_new_impl(PyTypeObject *type, PyObject *level,
     }
 
     self->use_multithread = 0;
+    self->compression_level = ZSTD_CLEVEL_DEFAULT;
     self->dict = NULL;
     self->lock = (PyMutex){0};