cpython: 82cfbe2ddfbb (original) (raw)
Mercurial > cpython
changeset 70039:82cfbe2ddfbb 3.1
Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError. With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused IDLE to exit. Converted to valid Unicode null in PythonCmd(). [#1028]
Kurt B. Kaiser kbk@shore.net | |
---|---|
date | Wed, 11 May 2011 12:24:17 -0400 |
parents | fd7d4639dae2 |
children | 65a6a2f8721f da7a120c0478 |
files | Lib/idlelib/NEWS.txt Misc/NEWS Modules/_tkinter.c |
diffstat | 3 files changed, 23 insertions(+), 4 deletions(-)[+] [-] Lib/idlelib/NEWS.txt 9 Misc/NEWS 4 Modules/_tkinter.c 14 |
line wrap: on
line diff
--- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -1,18 +1,21 @@ What's New in IDLE 3.1.4? ========================= -Release date: XX-XXX-XX +Release date: 15-May-11 + +- Issue #1028: Ctrl-space binding to show completions was causing IDLE to exit.
- toggle failing on Tk 8.5, causing IDLE exits and strange selection behavior. Issue 4676. Improve selection extension behaviour. +
- toggle non-functional when NumLock set on Windows. Issue 3851. - What's New in IDLE 3.1b1? ========================= -Release date: XX-XXX-09 +Release date: 06-May-09
- Use of 'filter' in keybindingDialog.py was causing custom key assignment to fail. Patch 5707 amaury.forgeotdarc.
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -69,6 +69,10 @@ Core and Builtins Library ------- +- Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
- With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused
- IDLE to exit. Converted to valid Unicode null in PythonCmd(). +
- Issue #10419: Fix build_scripts command of distutils to handle correctly non-ASCII scripts. Open and write the script in binary mode, but ensure that the shebang is decodable from UTF-8 and from the encoding of the script.
--- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -2023,7 +2023,19 @@ PythonCmd(ClientData clientData, Tcl_Int for (i = 0; i < (argc - 1); i++) { PyObject *s = PyUnicode_FromString(argv[i + 1]);
if (!s || PyTuple_SetItem(arg, i, s)) {[](#l3.7)
if (!s) {[](#l3.8)
/* Is Tk leaking 0xC080 in %A - a "modified" utf-8 null? */[](#l3.9)
if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError) &&[](#l3.10)
!strcmp(argv[i + 1], "\xC0\x80")) {[](#l3.11)
PyErr_Clear();[](#l3.12)
/* Convert to "strict" utf-8 null */[](#l3.13)
s = PyUnicode_FromString("\0");[](#l3.14)
} else {[](#l3.15)
Py_DECREF(arg);[](#l3.16)
return PythonCmd_Error(interp);[](#l3.17)
}[](#l3.18)
}[](#l3.19)
if (PyTuple_SetItem(arg, i, s)) {[](#l3.20) Py_DECREF(arg);[](#l3.21) return PythonCmd_Error(interp);[](#l3.22) }[](#l3.23)