Skip to content

Write documentation for codecs.escape_encode() and codecs.escape_decode() #136278

@malemburg

Description

@malemburg

Those APIs are used by pickle and provide a great way to handle escaped bytes sequences in much the same way as str(bytes)/repr(bytes) works.

In Python 2, these were used by the string_escape codec, but that was removed for some reason. Perhaps we should revive this as bytes_escape codec.

Example:
codecs.escape_decode(str(b))[0][2:-1] == b

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions