This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author culler
Recipients culler
Date 2010-12-18.15:22:39
SpamBayes Score 1.2996306e-07
Marked as misclassified No
Message-id <1292685761.16.0.751551658727.issue10731@psf.upfronthosting.co.za>
In-reply-to
Content
In OS X tkinter the "two-finger scroll" generates <MouseWheel> events.

The following code:

#### bug.py
import tkinter

def mouse_wheel(event):
    print('Mouse wheel event')

tk = tkinter.Tk()
list = tkinter.Listbox(tk)
list.bind('<MouseWheel>', mouse_wheel)
for n in range(20):
    list.insert(tkinter.END, str(n**n))
list.pack(fill=tkinter.BOTH, expand=1)
tk.mainloop()
####

often throws a UnicodeDecodeError exception with a traceback like the one shown below when you do a "two-finger scroll" in the window.

Traceback (most recent call last):
  File "bug.py", line 12, in <module>
    tk.mainloop()
  File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/tkinter/__init__.py", line 1009, in mainloop
    self.tk.mainloop(n)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x84 in position 1: unexpected code byte

The value of the byte changes from time to time, and sometimes it may be possible to scroll a few times without producing the error.

This problem did not occur on my Mandriva 2010.2 system.  I think it is specific to the Macintosh.  It might possibly be related to:
http://bugs.python.org/issue834351
History
Date User Action Args
2010-12-18 15:22:41cullersetrecipients: + culler
2010-12-18 15:22:41cullersetmessageid: <1292685761.16.0.751551658727.issue10731@psf.upfronthosting.co.za>
2010-12-18 15:22:39cullerlinkissue10731 messages
2010-12-18 15:22:39cullercreate