Skip to content

Use PyUnicode_FromFormat() and PyErr_Format() instead of sprintf #99426

Description

@serhiy-storchaka

In some sites PyUnicode_FromFormat() and PyErr_Format() can be used instead of sprintf to a static or dynamically allocated buffer followed by (implicit) PyUnicode_FromString() or PyErr_SetString(). It would consume slightly more CPU and memory resources, but none of these places are performance critical and the new code is clearer.

Activity

  1. added a commit that references this issue on Nov 13, 2022
  2. added a commit that references this issue on Nov 14, 2022
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

    3.12only security fixestype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions