diff -r 92fc6850dea0 Modules/_tkinter.c --- a/Modules/_tkinter.c Tue Feb 04 14:27:14 2014 -0800 +++ b/Modules/_tkinter.c Wed Feb 05 00:03:28 2014 +0100 @@ -1397,6 +1397,9 @@ if (PyUnicode_Check(in)) { Py_ssize_t size; s = PyUnicode_AsUTF8AndSize(in, &size); + if (s == NULL) { + return 0; + } if (size > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "string is too long"); return 0;