diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-01-25 20:56:57 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-01-25 20:56:57 (GMT) |
commit | 07985ef387a87486a0e632844be03a8877e7f889 (patch) | |
tree | b89d636e8ba7b0cd170064698741aebb46951eb5 /Doc/library/codecs.rst | |
parent | 58f02019e0a772b5689b69182f4f162666657294 (diff) | |
download | cpython-07985ef387a87486a0e632844be03a8877e7f889.zip cpython-07985ef387a87486a0e632844be03a8877e7f889.tar.gz cpython-07985ef387a87486a0e632844be03a8877e7f889.tar.bz2 |
Issue #22286: The "backslashreplace" error handlers now works with
decoding and translating.
Diffstat (limited to 'Doc/library/codecs.rst')
-rw-r--r-- | Doc/library/codecs.rst | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 3510f69..048f0e9 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -314,8 +314,8 @@ The following error handlers are only applicable to | | reference (only for encoding). Implemented | | | in :func:`xmlcharrefreplace_errors`. | +-------------------------+-----------------------------------------------+ -| ``'backslashreplace'`` | Replace with backslashed escape sequences | -| | (only for encoding). Implemented in | +| ``'backslashreplace'`` | Replace with backslashed escape sequences. | +| | Implemented in | | | :func:`backslashreplace_errors`. | +-------------------------+-----------------------------------------------+ | ``'namereplace'`` | Replace with ``\N{...}`` escape sequences | @@ -350,6 +350,10 @@ In addition, the following error handler is specific to the given codecs: .. versionadded:: 3.5 The ``'namereplace'`` error handler. +.. versionchanged:: 3.5 + The ``'backslashreplace'`` error handlers now works with decoding and + translating. + The set of allowed values can be extended by registering a new named error handler: @@ -417,9 +421,9 @@ functions: .. function:: backslashreplace_errors(exception) - Implements the ``'backslashreplace'`` error handling (for encoding with - :term:`text encodings <text encoding>` only): the - unencodable character is replaced by a backslashed escape sequence. + Implements the ``'backslashreplace'`` error handling (for + :term:`text encodings <text encoding>` only): malformed data is + replaced by a backslashed escape sequence. .. function:: namereplace_errors(exception) |