diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2007-08-27 01:55:21 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2007-08-27 01:55:21 (GMT) |
commit | ab45e27f6927729233f7f5d08d41285f5332265f (patch) | |
tree | 3533e6eb5d7d7ca12d133724564f1e14f1785e71 /Modules | |
parent | fac6e9dfe2aadf77c300a3b82707d633d08ee510 (diff) | |
download | cpython-ab45e27f6927729233f7f5d08d41285f5332265f.zip cpython-ab45e27f6927729233f7f5d08d41285f5332265f.tar.gz cpython-ab45e27f6927729233f7f5d08d41285f5332265f.tar.bz2 |
Tkinter binding involving Control-spacebar raises unicode error
Issue1028
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index c0b47c2..507c9da 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1897,7 +1897,7 @@ static int PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { PythonCmd_ClientData *data = (PythonCmd_ClientData *)clientData; - PyObject *self, *func, *arg, *res; + PyObject *self, *func, *arg, *res, *s; int i, rv; Tcl_Obj *tres; @@ -1914,7 +1914,13 @@ PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) return PythonCmd_Error(interp); for (i = 0; i < (argc - 1); i++) { - PyObject *s = PyUnicode_FromString(argv[i + 1]); + if (11 == (i + 1)) { /* the %A arg is the unicode char */ + char *a = argv[i + 1]; + s = PyUnicode_FromUnicode((Py_UNICODE *) a, strlen(a)); + } + else { + s = PyUnicode_FromString(argv[i + 1]); + } if (!s || PyTuple_SetItem(arg, i, s)) { Py_DECREF(arg); return PythonCmd_Error(interp); |