Skip to content

Invalid signature of PyUnicodeWriter_WriteUCS4() #146143

Description

@serhiy-storchaka

Bug report

Currently the signature of PyUnicodeWriter_WriteUCS4() is

int PyUnicodeWriter_WriteUCS4(PyUnicodeWriter *writer, const Py_UCS4 *str, Py_ssize_t size);

It requires a pointer to mutable buffer of Py_UCS4, even if it does not mutate it. This is a bug which prevents the use of PyUnicodeWriter_WriteUCS4() with immutable buffers of Py_UCS4.

We need simply to add const:

int PyUnicodeWriter_WriteUCS4(PyUnicodeWriter *writer, const Py_UCS4 *str, Py_ssize_t size);

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

    3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions