summaryrefslogtreecommitdiff
path: root/Doc/library/codecs.rst
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-15 00:56:47 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-10-15 00:56:47 +0000
commitc73e9d844fcc9e91eff5ff933336aa46005bdefc (patch)
tree1152d5daa55391c34079e65ae2a6f720b47699ef /Doc/library/codecs.rst
parent1cea56b5973c3baf506f88cbd465c020957727d5 (diff)
downloadcpython-git-c73e9d844fcc9e91eff5ff933336aa46005bdefc.tar.gz
Issue #23231: Document codecs.iterencode(), iterdecode() shortcomings
Diffstat (limited to 'Doc/library/codecs.rst')
-rw-r--r--Doc/library/codecs.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 1add30072f..03f0228476 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -224,6 +224,10 @@ wider range of codecs when working with binary files:
The *errors* argument (as well as any
other keyword argument) is passed through to the incremental encoder.
+ This function requires that the codec accept text :class:`str` objects
+ to encode. Therefore it does not support bytes-to-bytes encoders such as
+ ``base64_codec``.
+
.. function:: iterdecode(iterator, encoding, errors='strict', **kwargs)
@@ -232,6 +236,11 @@ wider range of codecs when working with binary files:
The *errors* argument (as well as any
other keyword argument) is passed through to the incremental decoder.
+ This function requires that the codec accept :class:`bytes` objects
+ to decode. Therefore it does not support text-to-text encoders such as
+ ``rot_13``, although ``rot_13`` may be used equivalently with
+ :func:`iterencode`.
+
The module also provides the following constants which are useful for reading
and writing to platform dependent files: