New submission from Kurt B. Kaiser: The control-spacebar binding is used in IDLE to force open the completions window. It's causing IDLE to exit with a utf8 decode error. Attached is a Tkinter cut-down exhibiting the problem and a patch.
The cutdown runs ok on 2.6 but not on py3k because the latter uses PyUnicode_FromString on all the arguments and errs out when it encounters a character outside the utf-8 range. Strangely, on my system, control-spacebar is sending a two byte string, C0E8 via the %A parameter. Control-2 does the same. Other keys with combinations of modifier keys send one byte. Linux trader 2.6.18-ARCH #1 SMP PREEMPT Sun Nov 19 09:14:35 CET 2006 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux Can the problem be confirmed? Using PyUnicode_FromUnicode on %A works because the unicode string is copied instead of decoded, and that parameter is supposed to be unicode, in any case. The patch fixes the problem on my system but should be reviewed, especially whether the cast in the call to PyUnicode_FromUnicode is suitably cross- platform. Assigning to Neal since he's working a lot of Unicode issues right now. I can check it in if I get approval. ---------- assignee: nnorwitz components: Tkinter files: tkintertest.py keywords: patch, py3k messages: 55311 nosy: kbk severity: normal status: open title: Tkinter binding involving Control-spacebar raises unicode error versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1028> __________________________________
tkintertest.py
Description: application/python
_______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com