Weeble <clockworksa...@gmail.com> added the comment:

Just got a chance to test this on a Windows desktop with a proper 
keyboard. (My laptop does weird things with num-lock and scroll-lock.) I 
got it to crash once, but I have no idea what was special about that 
time. Otherwise I can reproduce the exception traceback printed to the 
console, with the following steps:

1) Start IDLE from the console, e.g.:
    python c:\python26\Lib\idlelib\idle.py
2) Make sure num-lock is turned OFF.
3) Enter a few characters, e.g:
    rhubarb
4) Press shift+left to create a selection of at least one character.
5) Press shift+home. The stack trace appears in the console:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
    return self.func(*args)
  File "C:\Python26\lib\idlelib\MultiCall.py", line 150, in handler
    r = l[i](event)
  File "C:\Python26\lib\idlelib\EditorWindow.py", line 333, in 
home_callback
    if self.text.compare(first,">",last):
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 2858, in compare
    self._w, 'compare', index1, op, index2))
TclError: expected boolean value but got ""

This is consistent with my understanding that Tk 8.5 does not use a mark 
named "anchor" to indicate the selection anchor. I have written a patch 
that directly calls "tk::TextKeySelect" instead of trying to duplicate 
its behaviour using the "anchor" mark. I'm not terribly confident with 
using diff and patch, so please let me know if I've done it wrong. I did 
use -u.

Added file: http://bugs.python.org/file12866/IDLE_fix_shift_home.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4676>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to