Issue #17827: Document codecs.encode and codecs.decode

This commit is contained in:
Nick Coghlan 2013-10-14 00:22:13 +10:00
parent aeaecfd257
commit 6cb2b5b1e1
2 changed files with 22 additions and 0 deletions

View File

@ -22,6 +22,25 @@ manages the codec and error handling lookup process.
It defines the following functions: It defines the following functions:
.. function:: encode(obj, encoding='utf-8', errors='strict')
Encodes *obj* using the codec registered for *encoding*.
*Errors* may be given to set the desired error handling scheme. The
default error handler is ``strict`` meaning that encoding errors raise
:exc:`ValueError` (or a more codec specific subclass, such as
:exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more
information on codec error handling.
.. function:: decode(obj, encoding='utf-8', errors='strict')
Decodes *obj* using the codec registered for *encoding*.
*Errors* may be given to set the desired error handling scheme. The
default error handler is ``strict`` meaning that decoding errors raise
:exc:`ValueError` (or a more codec specific subclass, such as
:exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more
information on codec error handling.
.. function:: register(search_function) .. function:: register(search_function)

View File

@ -76,6 +76,9 @@ Core and Builtins
Library Library
------- -------
- Issue #17827: Add the missing documentation for ``codecs.encode`` and
``codecs.decode``.
- Issue #18458: Prevent crashes with newer versions of libedit. Its readline - Issue #18458: Prevent crashes with newer versions of libedit. Its readline
emulation has changed from 0-based indexing to 1-based like gnu readline. emulation has changed from 0-based indexing to 1-based like gnu readline.
Original patch by Ronald Oussoren. Original patch by Ronald Oussoren.