python / python/cpython

`PyUnicode_DecodeCharmap`: `mapping` argument not fully documented

Open
#156,098 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs easy topic-C-API
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Documentation

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

https://github.com/python/cpython/blob/e8158d1a02d6e5e974d4dbc0633b6a3ad960d7a3/Objects/unicodeobject.c#L8826-L8833

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

Linked PRs
  • gh-156147

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the character-map codecs documentation and compare it with the PyUnicode_DecodeCharmap implementation in Objects/unicodeobject.c at the referenced lines. Done means the mapping argument's acceptance of a str is documented on the relevant C API page; gh-156147 is already linked in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.