Skip to content

Invalid signature of PyUnicodeWriter_WriteUCS4() #146143

Closed

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

  1. added
    type-bug
    3.14
    3.15
    on Mar 18, 2026
  2. added 2 commits that reference this issue on Mar 18, 2026
  3. added
    interpreter-core
    on Mar 18, 2026
  4. added a commit that references this issue on Mar 19, 2026
  5. added a commit that references this issue on Apr 25, 2026
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.143.15interpreter-coretopic-C-APItype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions