classification
Title: Tttk tag_has() throws TypeError when called without item
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: ddurrett, gpolo, python-dev, serhiy.storchaka
Priority: normal Keywords:

Created on 2014-10-30 22:58 by ddurrett, last changed 2014-11-07 10:36 by serhiy.storchaka. This issue is now closed.

Messages (3)
msg230305 - (view) Author: David Durrett (ddurrett) Date: 2014-10-30 22:58
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.
msg230357 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-31 17:12
Thank your for your report David.

Here is a patch which fixes the bug and adds tests for Treeview.tag_has().
msg230781 - (view) Author: Roundup Robot (python-dev) Date: 2014-11-07 10:12
New changeset b3a5b53173c0 by Serhiy Storchaka in branch '2.7':
Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
https://hg.python.org/cpython/rev/b3a5b53173c0

New changeset cd17aa63492e by Serhiy Storchaka in branch '3.4':
Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
https://hg.python.org/cpython/rev/cd17aa63492e

New changeset 0b56adcb737d by Serhiy Storchaka in branch 'default':
Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
https://hg.python.org/cpython/rev/0b56adcb737d
History
Date User Action Args
2014-11-07 10:36:21serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-11-07 10:12:44python-devsetnosy: + python-dev
messages: + msg230781
2014-10-31 17:12:03serhiy.storchakasetmessages: + msg230357
stage: needs patch -> patch review
2014-10-30 23:18:03serhiy.storchakasetassignee: serhiy.storchaka
stage: needs patch
versions: + Python 3.4, Python 3.5
2014-10-30 22:58:45ddurrettcreate