From: Rogdham <3994389+Rogdham@users.noreply.github.com> Date: Sat, 18 Jul 2026 04:15:39 +0000 (+0200) Subject: gh-150583: Fix zstd compression level with digested ZstdDict (#150586) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0983642c966d9c536416101e99b7d2b085483847;p=thirdparty%2FPython%2Fcpython.git gh-150583: Fix zstd compression level with digested ZstdDict (#150586) --- 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 index 000000000000..edb551b3c3c8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-03-19-35-32.gh-issue-150583.dedI24.rst @@ -0,0 +1,2 @@ +Correctly set the default compression level in :mod:`compression.zstd` when passing a digested +dictionary during compression. diff --git a/Modules/_zstd/compressor.c b/Modules/_zstd/compressor.c index b2eb22d9ec8a..894568fce28d 100644 --- a/Modules/_zstd/compressor.c +++ b/Modules/_zstd/compressor.c @@ -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};