]> granicus.if.org Git - python/commitdiff
Issue #12342: Improve _tkinter error message on unencodable character
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 3 Nov 2011 23:36:46 +0000 (00:36 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 3 Nov 2011 23:36:46 +0000 (00:36 +0100)
Modules/_tkinter.c

index 672837f2b5984ea6b7c915220db2cdfb962d3358..3608e2d993a26d72dd1ddadd1048018cb2521796 100644 (file)
@@ -993,8 +993,10 @@ AsObj(PyObject *value)
         for (i = 0; i < size; i++) {
             if (inbuf[i] >= 0x10000) {
                 /* Tcl doesn't do UTF-16, yet. */
-                PyErr_SetString(PyExc_ValueError,
-                                "unsupported character");
+                PyErr_Format(PyExc_ValueError,
+                             "character U+%x is above the range "
+                             "(U+0000-U+FFFF) allowed by Tcl",
+                             inbuf[i]);
                 ckfree(FREECAST outbuf);
                 return NULL;
             }