gh-126004: Fix positions handling in `codecs.xmlcharrefreplace_errors… · python/cpython@70dcc84 · GitHub
Skip to content

Commit 70dcc84

Browse files
authored
gh-126004: Fix positions handling in codecs.xmlcharrefreplace_errors (#127675)
This fixes how `PyCodec_XMLCharRefReplaceErrors` handles the `start` and `end` attributes of `UnicodeError` objects via the `_PyUnicodeError_GetParams` helper.
1 parent a10f993 commit 70dcc84

3 files changed

Lines changed: 108 additions & 91 deletions

File tree

‎Lib/test/test_capi/test_codecs.py‎

Lines changed: 4 additions & 3 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
2+
values in the :func:`codecs.xmlcharrefreplace_errors` error handler.
3+
Patch by Bénédikt Tran.

‎Python/codecs.c‎

Lines changed: 101 additions & 88 deletions

0 commit comments

Comments
 (0)