diff -r 5b5ef012cd4e Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py Thu Aug 22 17:53:06 2013 +0300 +++ b/Lib/tkinter/__init__.py Fri Aug 23 09:44:02 2013 +0300 @@ -1352,7 +1352,7 @@ value = words[i+1] if not value: value = None - elif '.' in str(value): + elif '.' in value: value = getdouble(value) else: value = getint(value) @@ -1921,7 +1921,7 @@ for i in range(0, len(words), 2): key = words[i][1:] value = words[i+1] - if str(value)[:1] == '.': + if value[:1] == '.': value = self._nametowidget(value) dict[key] = value return dict @@ -1972,7 +1972,7 @@ for i in range(0, len(words), 2): key = words[i][1:] value = words[i+1] - if str(value)[:1] == '.': + if value[:1] == '.': value = self._nametowidget(value) dict[key] = value return dict @@ -2021,7 +2021,7 @@ for i in range(0, len(words), 2): key = words[i][1:] value = words[i+1] - if str(value)[:1] == '.': + if value[:1] == '.': value = self._nametowidget(value) dict[key] = value return dict diff -r 5b5ef012cd4e Lib/tkinter/test/test_ttk/test_widgets.py --- a/Lib/tkinter/test/test_ttk/test_widgets.py Thu Aug 22 17:53:06 2013 +0300 +++ b/Lib/tkinter/test/test_ttk/test_widgets.py Fri Aug 23 09:44:02 2013 +0300 @@ -105,7 +105,7 @@ cbtn['command'] = '' res = cbtn.invoke() - self.assertEqual(str(res), '') + self.assertEqual(res, '') self.assertFalse(len(success) > 1) self.assertEqual(cbtn['offvalue'], cbtn.tk.globalgetvar(cbtn['variable'])) @@ -453,7 +453,7 @@ cbtn2['command'] = '' res = cbtn2.invoke() - self.assertEqual(str(res), '') + self.assertEqual(res, '') self.assertFalse(len(success) > 1) self.assertEqual(cbtn2['value'], myvar.get()) self.assertEqual(myvar.get(), diff -r 5b5ef012cd4e Misc/NEWS --- a/Misc/NEWS Thu Aug 22 17:53:06 2013 +0300 +++ b/Misc/NEWS Fri Aug 23 09:44:02 2013 +0300 @@ -38,8 +38,6 @@ Library ------- -- Issue #16809: Fixed some tkinter incompabilities with Tcl/Tk 8.6. - - Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj argument. diff -r 5b5ef012cd4e Modules/_tkinter.c --- a/Modules/_tkinter.c Thu Aug 22 17:53:06 2013 +0300 +++ b/Modules/_tkinter.c Fri Aug 23 09:44:02 2013 +0300 @@ -263,6 +263,7 @@ Tcl_ObjType *ListType; Tcl_ObjType *ProcBodyType; Tcl_ObjType *StringType; + Tcl_ObjType *WindowType; } TkappObject; #define Tkapp_Interp(v) (((TkappObject *) (v))->interp) @@ -551,6 +552,7 @@ v->ListType = Tcl_GetObjType("list"); v->ProcBodyType = Tcl_GetObjType("procbody"); v->StringType = Tcl_GetObjType("string"); + v->WindowType = Tcl_GetObjType("window"); /* Delete the 'exit' command, which can screw things up */ Tcl_DeleteCommand(v->interp, "exit"); @@ -1007,6 +1009,12 @@ #endif } + if (value->typePtr == app->WindowType) { + return PyUnicode_FromKindAndData( + sizeof(Tcl_UniChar), Tcl_GetUnicode(value), + Tcl_GetCharLength(value)); + } + return newPyTclObject(value); } diff -r 5b5ef012cd4e Python/pythonrun.c --- a/Python/pythonrun.c Thu Aug 22 17:53:06 2013 +0300 +++ b/Python/pythonrun.c Fri Aug 23 09:44:02 2013 +0300 @@ -1052,7 +1052,7 @@ PyObject *std = NULL; int status = 0, fd; PyObject * encoding_attr; - char *encoding = NULL, *errors; + char *pythonioencoding = NULL, *encoding, *errors; /* Hack to avoid a nasty recursion issue when Python is invoked in verbose mode: pre-import the Latin-1 and UTF-8 codecs */ @@ -1084,19 +1084,21 @@ } Py_DECREF(wrapper); - encoding = Py_GETENV("PYTHONIOENCODING"); - errors = NULL; - if (encoding) { - encoding = _PyMem_Strdup(encoding); - if (encoding == NULL) { + pythonioencoding = Py_GETENV("PYTHONIOENCODING"); + encoding = errors = NULL; + if (pythonioencoding) { + pythonioencoding = _PyMem_Strdup(pythonioencoding); + if (pythonioencoding == NULL) { PyErr_NoMemory(); goto error; } - errors = strchr(encoding, ':'); + errors = strchr(pythonioencoding, ':'); if (errors) { *errors = '\0'; errors++; } + if (*pythonioencoding) + encoding = pythonioencoding; } /* Set sys.stdin */ @@ -1176,7 +1178,7 @@ status = -1; } - PyMem_Free(encoding); + PyMem_Free(pythonioencoding); Py_XDECREF(bimod); Py_XDECREF(iomod); return status;