[Python-checkins] cpython (3.2): Issue #12342: Improve _tkinter error message on unencodable character

victor.stinner python-checkins at python.org
Fri Nov 4 00:42:17 CET 2011


http://hg.python.org/cpython/rev/9a07b73abdb1
changeset:   73340:9a07b73abdb1
branch:      3.2
parent:      73331:38f4a251608f
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Fri Nov 04 00:36:46 2011 +0100
summary:
  Issue #12342: Improve _tkinter error message on unencodable character

files:
  Modules/_tkinter.c |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -993,8 +993,10 @@
         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;
             }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list