Skip to content

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

Closed
@serhiy-storchaka

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12bugs and security fixestype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions