Skip to content

Commit 6fe011b

Browse files
committed
gh-127305: more detailed doc for register_error's error_handler
1 parent 37d16f7 commit 6fe011b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/codecs.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,10 @@ handler:
462462
where encoding should continue. The replacement may be either :class:`str` or
463463
:class:`bytes`. If the replacement is bytes, the encoder will simply copy
464464
them into the output buffer. If the replacement is a string, the encoder will
465-
encode the replacement. Encoding continues on original input at the
466-
specified position. Negative position values will be treated as being
465+
encode the replacement with the ``'strict'`` error handling, which means
466+
:exc:`UnicodeEncodeError` may be raised here.
467+
Encoding continues on originalinput at the specified position.
468+
Negative position values will be treated as being
467469
relative to the end of the input string. If the resulting position is out of
468470
bound an :exc:`IndexError` will be raised.
469471

0 commit comments

Comments
 (0)