cpython: bdb30bdf60a5 (original) (raw)
Mercurial > cpython
changeset 86916:bdb30bdf60a5 2.7
Close #17827: Document codecs.encode & codecs.decode [#17827]
Nick Coghlan ncoghlan@gmail.com | |
---|---|
date | Mon, 04 Nov 2013 20:05:16 +1000 |
parents | 72c3ca3ed22a |
children | 7268838063e1 |
files | Doc/library/codecs.rst Misc/NEWS |
diffstat | 2 files changed, 27 insertions(+), 0 deletions(-)[+] [-] Doc/library/codecs.rst 23 Misc/NEWS 4 |
line wrap: on
line diff
--- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -23,6 +23,29 @@ manages the codec and error handling loo It defines the following functions: +.. function:: encode(obj, encoding='ascii', 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. +
- .. versionadded:: 2.4 +
+.. function:: decode(obj, encoding='ascii', 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. +
- .. versionadded:: 2.4
.. function:: register(search_function)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,9 +12,13 @@ Core and Builtins
Library
-------
+- Issue #17827: Add the missing documentation for codecs.encode
and