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/io.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/io.rst')
-rw-r--r-- | Doc/library/io.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst index c77db90..b0b1af3 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -825,11 +825,12 @@ Text I/O exception if there is an encoding error (the default of ``None`` has the same effect), or pass ``'ignore'`` to ignore errors. (Note that ignoring encoding errors can lead to data loss.) ``'replace'`` causes a replacement marker - (such as ``'?'``) to be inserted where there is malformed data. When - writing, ``'xmlcharrefreplace'`` (replace with the appropriate XML character - reference), ``'backslashreplace'`` (replace with backslashed escape - sequences) or ``'namereplace'`` (replace with ``\N{...}`` escape sequences) - can be used. Any other error handling name that has been registered with + (such as ``'?'``) to be inserted where there is malformed data. + ``'backslashreplace'`` causes malformed data to be replaced by a + backslashed escape sequence. When writing, ``'xmlcharrefreplace'`` + (replace with the appropriate XML character reference) or ``'namereplace'`` + (replace with ``\N{...}`` escape sequences) can be used. Any other error + handling name that has been registered with :func:`codecs.register_error` is also valid. .. index:: |