Skip to content

Fix format strings on 32bit platforms#1226

Merged
bdraco merged 6 commits intoaio-libs:masterfrom
bdraco:fix_format_strings
Jun 28, 2025
Merged

Fix format strings on 32bit platforms#1226
bdraco merged 6 commits intoaio-libs:masterfrom
bdraco:fix_format_strings

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Jun 28, 2025

What do these changes do?

This PR fixes format string specifiers in the _md_dump debug function that were causing compilation failures on 32-bit platforms. The issue was that %ld format specifiers were being used for Py_ssize_t values, which are int on 32-bit platforms but long int on 64-bit platforms. All %ld specifiers for Py_ssize_t values have been changed to %zd, which is the correct portable format specifier that automatically adjusts to the platform's size.

Are there changes in behavior for the user?

No functional changes for end users. This fix only affects debug builds (when MULTIDICT_DEBUG_BUILD environment variable is set) and allows them to compile successfully on 32-bit platforms. The _md_dump function is only compiled in debug builds and is used for internal debugging purposes.

Related issue number

Fixes #1225

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

Note: No unit tests or documentation changes are needed for this fix as it only corrects format specifiers in a debug-only function that doesn't affect the public API or runtime behavior.

@bdraco bdraco closed this Jun 28, 2025
@bdraco bdraco reopened this Jun 28, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 28, 2025

CodSpeed Performance Report

Merging #1226 will not alter performance

Comparing bdraco:fix_format_strings (3f86072) with master (17bbfd0)

Summary

✅ 245 untouched benchmarks

@codecov
Copy link

codecov bot commented Jun 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.39%. Comparing base (17bbfd0) to head (3f86072).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1226   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files          27       27           
  Lines        3988     3988           
  Branches      735      735           
=======================================
  Hits         3924     3924           
  Misses         17       17           
  Partials       47       47           
Flag Coverage Δ
CI-GHA 98.39% <ø> (ø)
MyPy 80.51% <ø> (ø)
pytest 99.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jun 28, 2025
@bdraco bdraco marked this pull request as ready for review June 28, 2025 12:55
@bdraco bdraco requested review from asvetlov and webknjaz as code owners June 28, 2025 12:55
@bdraco bdraco enabled auto-merge (squash) June 28, 2025 13:00
Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

Perfect, thanks for your efforts!

@bdraco bdraco merged commit 149c693 into aio-libs:master Jun 28, 2025
64 checks passed
@bdraco bdraco deleted the fix_format_strings branch June 28, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6.6.1 fails to build on 32-bit platforms

2 participants