Skip to content

PyUnicode_DecodeCharmap: mapping argument not fully documented #156098

Description

@srittau

Documentation

PyUnicode_DecodeCharmap has a mapping argument that either takes a mapping or a str:

if (PyUnicode_CheckExact(mapping)) {
if (charmap_decode_string(s, size, mapping, errors, &writer) < 0)
goto onError;
}
else {
if (charmap_decode_mapping(s, size, mapping, errors, &writer) < 0)
goto onError;
}

That it takes a str is not documented: https://docs.python.org/3/c-api/unicode.html#character-map-codecs

Linked PRs

Activity

  1. Diogoec2006 commented on Oct 19, 2026

    @Diogoec2006

    Hi everyone! I would like to work on this issue.

    My plan to resolve it is to [explica aquí brevemente tu solución en inglés, por ejemplo: update the C implementation in module X / fix the documentation typo in Y / add a test case for this specific edge case].

    Does this approach sound good to the core team? If so, I'll go ahead and open a PR.

    Thanks!

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions