Skip to content

Commit 9e512ae

Browse files
gh-64612: Remove error handlers list under open() (GH-137304)
This was duplicated and out-of date.
1 parent 35759fe commit 9e512ae

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

Doc/library/functions.rst

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,38 +1422,10 @@ are always available. They are listed here in alphabetical order.
14221422

14231423
*errors* is an optional string that specifies how encoding and decoding
14241424
errors are to be handled—this cannot be used in binary mode.
1425-
A variety of standard error handlers are available
1426-
(listed under :ref:`error-handlers`), though any
1427-
error handling name that has been registered with
1425+
A variety of standard error handlers are available,
1426+
though any error handling name that has been registered with
14281427
:func:`codecs.register_error` is also valid. The standard names
1429-
include:
1430-
1431-
* ``'strict'`` to raise a :exc:`ValueError` exception if there is
1432-
an encoding error. The default value of ``None`` has the same
1433-
effect.
1434-
1435-
* ``'ignore'`` ignores errors. Note that ignoring encoding errors
1436-
can lead to data loss.
1437-
1438-
* ``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted
1439-
where there is malformed data.
1440-
1441-
* ``'surrogateescape'`` will represent any incorrect bytes as low
1442-
surrogate code units ranging from U+DC80 to U+DCFF.
1443-
These surrogate code units will then be turned back into
1444-
the same bytes when the ``surrogateescape`` error handler is used
1445-
when writing data. This is useful for processing files in an
1446-
unknown encoding.
1447-
1448-
* ``'xmlcharrefreplace'`` is only supported when writing to a file.
1449-
Characters not supported by the encoding are replaced with the
1450-
appropriate XML character reference :samp:`&#{nnn};`.
1451-
1452-
* ``'backslashreplace'`` replaces malformed data by Python's backslashed
1453-
escape sequences.
1454-
1455-
* ``'namereplace'`` (also only supported when writing)
1456-
replaces unsupported characters with ``\N{...}`` escape sequences.
1428+
can be found in :ref:`error-handlers`.
14571429

14581430
.. index::
14591431
single: universal newlines; open() built-in function

0 commit comments

Comments
 (0)