[Idle-dev] SearchBar - Have fun searching in IDLE!

Tal Einat taleinat at gmail.com
Thu Jun 25 15:53:04 CEST 2009

On Thu, Jun 25, 2009 at 4:18 PM, Weeble <clockworksaint at gmail.com> wrote:
> On Wed, Jun 24, 2009 at 11:15 AM, Tal Einat <taleinat at gmail.com> wrote:
>> This version should work with any 2.x version of Python from 2.3 onwards. I have tested with versions 2.3 through 2.6 on WindowsXP. I'd appreciate anyone who can give it a try and see how it works out, especially non-Windows users.
> Something's not working for me. I get lots of exceptions like this
> every time I type anything into the find box:
> 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\SearchBar.py", line 204, in
> _search_expression_changed_callback
>    elif self._set_search_expression():
>  File "c:\python26\lib\idlelib\SearchBar.py", line 523, in
> _set_search_expression
>    self.window_engine.set_search_expression(search_exp)
>  File "c:\python26\lib\idlelib\WindowSearchEngine.py", line 265, in
> set_search_expression
>    string, case_sensitive)
>  File "c:\python26\lib\idlelib\WindowSearchEngine.py", line 28, in __init__
>    self._mark_hits()
>  File "c:\python26\lib\idlelib\WindowSearchEngine.py", line 52, in _mark_hits
>    tag_add("findmark", start_idx, start_idx + add_string_len_str)
> TypeError: unsupported operand type(s) for +: '_tkinter.Tcl_Obj' and 'str'
> According to the About box, I'm on Python 2.6 and Tk 8.5.

Hi Weeble,

Thanks for taking the time to test this!

I only tested with Python2.6.2. Apparently at some point Tkinter was
patched to fix just this problem (issue 5193), so it seems Python2.6
doesn't include this patch while 2.6.2 does.

Workaround implemented. Updated files attached.

- Tal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SearchBar-0.6.1.tar.gz
Type: application/x-gzip
Size: 9098 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20090625/9c63a40e/attachment.bin>

More information about the IDLE-dev mailing list