mirror of
https://github.com/python/cpython.git
synced 2025-11-08 09:32:01 +00:00
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().
_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| lexer | ||
| tokenizer | ||
| action_helpers.c | ||
| asdl.py | ||
| asdl_c.py | ||
| myreadline.c | ||
| parser.c | ||
| peg_api.c | ||
| pegen.c | ||
| pegen.h | ||
| pegen_errors.c | ||
| Python.asdl | ||
| string_parser.c | ||
| string_parser.h | ||
| token.c | ||