]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-146578: _zstd: Fix printf format for pledged size errors (GH-146576) (...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 21 Apr 2026 20:31:46 +0000 (22:31 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Apr 2026 20:31:46 +0000 (13:31 -0700)
gh-146578: _zstd: Fix printf format for pledged size errors (GH-146576)

Use %llu instead of %ull for unsigned long long in zstd_contentsize_converter ValueError messages.
(cherry picked from commit 09233bd19879284395aff97d7357b693893e6dd7)

Co-authored-by: cui <cuiweixie@gmail.com>
Modules/_zstd/compressor.c

index 508b136817872bb442ec32a74d14d55bf2314dc5..45a1dd8da29073ae66b649992ac0d3e79a679dba 100644 (file)
@@ -74,7 +74,7 @@ zstd_contentsize_converter(PyObject *size, unsigned long long *p)
             if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
                 PyErr_Format(PyExc_ValueError,
                              "size argument should be a positive int less "
-                             "than %ull", ZSTD_CONTENTSIZE_ERROR);
+                             "than %llu", ZSTD_CONTENTSIZE_ERROR);
                 return 0;
             }
             return 0;
@@ -83,7 +83,7 @@ zstd_contentsize_converter(PyObject *size, unsigned long long *p)
             *p = ZSTD_CONTENTSIZE_ERROR;
             PyErr_Format(PyExc_ValueError,
                          "size argument should be a positive int less "
-                         "than %ull", ZSTD_CONTENTSIZE_ERROR);
+                         "than %llu", ZSTD_CONTENTSIZE_ERROR);
             return 0;
         }
         *p = pledged_size;