Skip to content

gh-53243: Document codecs.readbuffer_encode() #136284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Jul 4, 2025

@StanFromIreland
Copy link
Member Author

PS. Marc, you should add yourself as CODEOWNER of the codecs.rst file.

@StanFromIreland StanFromIreland requested a review from vstinner July 8, 2025 19:01
Copy link
Member

@malemburg malemburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please also see my comments.


Return a :class:`tuple` containing the raw bytes of *buffer*, a
:ref:`buffer-compatible object <bufferobjects>` or :class:`str`, and their
length.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this read "and its length in bytes" ?

For str objects, the AC (argument clinic) converts the object to a UTF-8 bytes object first and then treats uses the bytes object's buffer interface to read this.

Not sure whether this is relevant, but perhaps worth a mention, since this happens for all functions/methods which use Py_buffer arguments which accept str.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StanFromIreland Did you see my comment ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your comment just appeared now, so I presume you left it in the "pending" state (I've done this before!). I will fix it tomorrow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be (I really don't like or fully understand the Github UI). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants