mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
This commit is contained in:
parent
7f0514ad54
commit
5646648678
8 changed files with 173 additions and 22 deletions
|
@ -1486,6 +1486,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
|
|||
const char *errors /* error handling */
|
||||
);
|
||||
|
||||
/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape
|
||||
chars. */
|
||||
PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscape(
|
||||
const char *string, /* Unicode-Escape encoded string */
|
||||
Py_ssize_t length, /* size of string */
|
||||
const char *errors, /* error handling */
|
||||
const char **first_invalid_escape /* on return, points to first
|
||||
invalid escaped char in
|
||||
string. */
|
||||
);
|
||||
|
||||
PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
|
||||
PyObject *unicode /* Unicode object */
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue