https://github.com/python/cpython/commit/faee3625c3fca9fa16956178a2c99af80e046341 commit: faee3625c3fca9fa16956178a2c99af80e046341 branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: malemburg <m...@lemburg.com> date: 2025-07-09T10:07:10+02:00 summary:
[3.13] gh-53243: Document `codecs.readbuffer_encode()` (GH-136284) (#136451) gh-53243: Document `codecs.readbuffer_encode()` (GH-136284) Closes GH-53243 (cherry picked from commit f1dcf3c7bf90961b8d5475154d3f28cfef0a054f) Co-authored-by: Stan Ulbrych <89152624+stanfromirel...@users.noreply.github.com> files: M Doc/library/codecs.rst diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 962c81d599e8e8..33155fceb730d9 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -261,6 +261,20 @@ wider range of codecs when working with binary files: :func:`iterencode`. +.. function:: readbuffer_encode(buffer, errors=None, /) + + Return a :class:`tuple` containing the raw bytes of *buffer*, a + :ref:`buffer-compatible object <bufferobjects>` or :class:`str` + (encoded to UTF-8 before processing), and their length in bytes. + + The *errors* argument is ignored. + + .. code-block:: pycon + + >>> codecs.readbuffer_encode(b"Zito") + (b'Zito', 4) + + The module also provides the following constants which are useful for reading and writing to platform dependent files: _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: arch...@mail-archive.com