Skip to content

gh-146578: _zstd: Fix printf format for pledged size errors#146576

Open
cuiweixie wants to merge 1 commit intopython:mainfrom
cuiweixie:fix-zstd-printf-ull
Open

gh-146578: _zstd: Fix printf format for pledged size errors#146576
cuiweixie wants to merge 1 commit intopython:mainfrom
cuiweixie:fix-zstd-printf-ull

Conversation

@cuiweixie
Copy link
Copy Markdown
Contributor

@cuiweixie cuiweixie commented Mar 28, 2026

Summary

Replace invalid %ull with %llu in zstd_contentsize_converter ValueError
format strings. The correct specifier for unsigned long long is %llu.

Test plan

  • Build with _zstd; change affects error-message formatting only.

Use %llu instead of %ull for unsigned long long in
zstd_contentsize_converter ValueError messages.
@cuiweixie cuiweixie changed the title _zstd: Fix printf format for pledged size errors gh-146578: _zstd: Fix printf format for pledged size errors Mar 28, 2026
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Could you please add tests?

Most likely there are already tests for passing out of range size argument, but they do not test the error message or the test is too lenient. You can change ValueError to something other, like SystemError, run the test and look what fails.

@sunmy2019
Copy link
Copy Markdown
Member

Inspired by this, I wrote a plugin to capture similar issues. Are you guys interested? I can open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants