[issue10731] UnicodeDecodeError in OS X tkinter when binding to <MouseWheel>

Ned Deily report at bugs.python.org
Sun Apr 22 06:40:47 CEST 2012


Ned Deily <nad at acm.org> added the comment:

It looks like the problem is that the current Cocoa Tcl/Tk 8.5.x returns an incorrect MouseWheel event.  Using the supplied test program and breakpointing in PythonCmd (around Modules/_tkinter.c:2027 in default), I found that it is being called from Tcl for MouseWheel events with an "argc" of 20, which looks suspiciously like the length of argv[1], "4302153816mouse_wheel", rather than the number of arguments which should be more like 3.  It may also be an issue that affects Python because _tkinter still uses the older Tcl_CreateCommand interface rather than the newer Tcl_CreateObjCommand.  The same Tcl behavior is observed with Python 2.7 _tkinter.c but there the bogus arguments are translated using PyString_FromString which is unaffected by the garbage arguments.  It might be possible to workaround this problem in _tkinter but the next step is to open a Tcl/Tk issue against the Cocoa implementation and push for a proper fix there.

http://www.tcl.tk/man/tcl8.5/TclLib/CrtCommand.htm

----------
assignee: ronaldoussoren -> ned.deily

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10731>
_______________________________________


More information about the Python-bugs-list mailing list