Skip to content

codecs.charmap_build is untested and undocumented #48181

Closed

Description

@fijal
BPO 3931
Nosy @malemburg, @loewis, @birkenfeld, @terryjreedy, @merwok, @MojoVampire

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2008-09-22.12:06:14.954>
labels = ['type-bug', 'library', 'docs']
title = 'codecs.charmap_build is untested and undocumented'
updated_at = <Date 2019-03-15.22:35:04.722>
user = 'https://bugs.python.org/fijal'

bugs.python.org fields:

activity = <Date 2019-03-15.22:35:04.722>
actor = 'BreamoreBoy'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Library (Lib)']
creation = <Date 2008-09-22.12:06:14.954>
creator = 'fijal'
dependencies = []
files = []
hgrepos = []
issue_num = 3931
keywords = []
message_count = 7.0
messages = ['73569', '75012', '112747', '120987', '220400', '220407', '237006']
nosy_count = 7.0
nosy_names = ['lemburg', 'loewis', 'georg.brandl', 'terry.reedy', 'fijal', 'eric.araujo', 'josh.r']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3931'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

Linked PRs

Activity

  1. fijal commented on Sep 22, 2008

    @fijal
    Author

    Although it doesn't start with _ and is definitely necessary as codecs
    call it.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or error
    on Sep 22, 2008
  3. malemburg commented on Oct 20, 2008

    @malemburg
    Member

    AFAIR, this code was added by Martin as optimization.

    The function is a direct interface to PyUnicode_BuildEncodingMap() which
    builds either a dictionary or EncodingMap object for use by the charmap
    codec.

    It is primarily used by the gencodec.py script.

  4. terryjreedy commented on Aug 4, 2010

    @terryjreedy
    Member

    There are numerous undocumented implementation objects that are either private and probably should start with _ but do not, or are semi-private and perhaps left public for the expert user willing to read code. But, being undocumented, it is hard to tell. codecs.charmap_build strikes me as rather private, hence should not be documented. So I would be inclined to close this.

  5. merwok commented on Nov 12, 2010

    @merwok
    Member

    I see charmap_build used in encodings too, so it may be useful to make it officially public for the use of third-party encodings.

  6. BreamoreBoy commented on Jun 13, 2014

    BreamoreBoymannequin
    Mannequin

    msg120987 states the opposite to msg112747 so what do we do with this issue?

  7. MojoVampire commented on Jun 13, 2014

    MojoVampiremannequin
    Mannequin

    I've found it rather ugly to even understand from the lack of code comments for the C level API it's wrapping. If nothing else, comments explaining the usage and purpose might be helpful.

  8. BreamoreBoy commented on Mar 2, 2015

    BreamoreBoymannequin
    Mannequin

    I do not see much purpose in documenting and testing this one function alone. I think that all functions in _codecsmodule.c should be looked at to see if they are private or public, but I'm certainly not volunteering to do it.

  9. transferred this issue fromon Apr 10, 2022
  10. 2 remaining items

  11. malemburg commented on Jul 9, 2022

    @malemburg
    Member
  12. eamanu commented on Jul 10, 2022

    @eamanu
    Contributor

    @malemburg great. Let me know if I can help in something :-)

  13. added a commit that references this issue on Jun 30, 2025
  14. added 2 commits that reference this issue on Jun 30, 2025
  15. added 2 commits that reference this issue on Jun 30, 2025
  16. StanFromIreland commented on Jun 30, 2025

    @StanFromIreland
    Member

    Closing since the docs have been merged and as for tests, as you said before:

    Testing of the API is mostly done indirectly by the charmap codec tests.

  17. added a commit that references this issue on Jul 11, 2025
  18. added a commit that references this issue on Jul 12, 2025
  19. added a commit that references this issue on Jul 13, 2025
  20. added a commit that references this issue on Aug 4, 2025
  21. added a commit that references this issue on Aug 19, 2025
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

    docsDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions