Skip to content

C API: Fix PyUnicodeWriter_WriteUTF8() and PyUnicodeWriter_Format() error handling #158439

Description

@vstinner

If PyUnicodeWriter_WriteUTF8() or PyUnicodeWriter_Format() fails, the writer should remain valid and usable for further writes. These functions can change the buffer kind to support write larger character. But if these functions fail, PyUnicodeWriter_Finish() may need to change the buffer kind to use the most efficient storage for the final string.

Linked PRs

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions