[New-bugs-announce] [issue22769] Tttk tag_has() throws TypeError when called without item

David Durrett report at bugs.python.org
Thu Oct 30 23:58:45 CET 2014

New submission from David Durrett:

Have only tried this on Python 2.7

To reproduce:

from Tkinter import *
import ttk

root = Tk()
tree = ttk.Treeview(root)

id = tree.insert('' , 'end', text='foo', tag='bar')
print tree.tag_has('bar', item=id)
# ^ this works..
print tree.tag_has('baz', item=id)
# ^ .. and this..
print tree.tag_has('bar')
# ^ .. this doesn't.
    self.tk.call(self._w, "tag", "has", tagname, item))
TypeError: must be string, not tuple

Possibly introduced by Issue20072.

Removing the self.tk.getboolean() wrapper in tag_has() appears to fix things.

components: Tkinter
messages: 230305
nosy: ddurrett, gpolo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Tttk tag_has() throws TypeError when called without item
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list