Skip to content

Some Unicode format specifiers are incorrect #146615

Description

@sunmy2019

Bug report

Bug description:

Inspired by #146578, I wrote a checker to check all unicode format strings.

There are 2 kinds of errors.

  1. There are ~8 real mistakes.
  2. Comply with C99 for va_list: https://en.cppreference.com/w/c/variadic/va_arg.html
    Most of the changes are %d <-> %ld for int and Py_ssize_t.

I opened an draft PR #146616 containing only the fixes to display what could be changed. We can discuss and cherry pick some fixes in that PR.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. serhiy-storchaka commented on Mar 30, 2026

    @serhiy-storchaka
    Member

    Wow, there were so many of them! No way we could pick all of them one by one. Thank you for your great work, @sunmy2019.

  2. added a commit that references this issue on Mar 31, 2026
  3. added 2 commits that reference this issue on Mar 31, 2026
  4. added 2 commits that reference this issue on Mar 31, 2026
  5. added a commit that references this issue on Mar 31, 2026
  6. added a commit that references this issue on Mar 31, 2026
  7. added a commit that references this issue on Mar 31, 2026
  8. added a commit that references this issue on Mar 31, 2026
  9. 22 remaining items

  10. added a commit that references this issue on Apr 1, 2026
  11. added a commit that references this issue on Apr 1, 2026
  12. vstinner commented on Apr 7, 2026

    @vstinner
    Member

    I added 2 PRs for what is missing.

    These two last PRs have been merged, so I close the issue. Thanks @sunmy2019 for your fixes!

  13. added 5 commits that reference this issue on Apr 16, 2026
  14. added 5 commits that reference this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions