Message124287
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 |
|
Date |
User |
Action |
Args |
2010-12-18 15:22:41 | culler | set | recipients:
+ culler |
2010-12-18 15:22:41 | culler | set | messageid: <1292685761.16.0.751551658727.issue10731@psf.upfronthosting.co.za> |
2010-12-18 15:22:39 | culler | link | issue10731 messages |
2010-12-18 15:22:39 | culler | create | |
|