Commit 7ab4192e authored by Victor Stinner's avatar Victor Stinner

Issue #12342: Improve _tkinter error message on unencodable character

parent b3bc7e76
...@@ -993,8 +993,10 @@ AsObj(PyObject *value) ...@@ -993,8 +993,10 @@ AsObj(PyObject *value)
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
if (inbuf[i] >= 0x10000) { if (inbuf[i] >= 0x10000) {
/* Tcl doesn't do UTF-16, yet. */ /* Tcl doesn't do UTF-16, yet. */
PyErr_SetString(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"unsupported character"); "character U+%x is above the range "
"(U+0000-U+FFFF) allowed by Tcl",
inbuf[i]);
ckfree(FREECAST outbuf); ckfree(FREECAST outbuf);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment