Skip to content

formatfloat wrong return in unicode_format.c #151845

Description

@aisk

Bug report

Bug description:

Original gist: https://gist.github.com/devdanzin/577421b083bad6802aa391b909d1a725

formatfloat (line 163): Returns 0 (success) when _PyUnicode_FromASCII fails. Caller has safety net, but violates return-value contract.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions