Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tttk tag_has() throws TypeError when called without item #66958

Closed
ddurrett mannequin opened this issue Oct 30, 2014 · 3 comments
Closed

Tttk tag_has() throws TypeError when called without item #66958

ddurrett mannequin opened this issue Oct 30, 2014 · 3 comments
Assignees
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@ddurrett
Copy link
Mannequin

ddurrett mannequin commented Oct 30, 2014

BPO 22769
Nosy @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/serhiy-storchaka'
closed_at = <Date 2014-11-07.10:36:21.928>
created_at = <Date 2014-10-30.22:58:45.087>
labels = ['type-bug', 'expert-tkinter']
title = 'Tttk tag_has() throws TypeError when called without item'
updated_at = <Date 2014-11-07.10:36:21.927>
user = 'https://bugs.python.org/ddurrett'

bugs.python.org fields:

activity = <Date 2014-11-07.10:36:21.927>
actor = 'serhiy.storchaka'
assignee = 'serhiy.storchaka'
closed = True
closed_date = <Date 2014-11-07.10:36:21.928>
closer = 'serhiy.storchaka'
components = ['Tkinter']
creation = <Date 2014-10-30.22:58:45.087>
creator = 'ddurrett'
dependencies = []
files = []
hgrepos = []
issue_num = 22769
keywords = []
message_count = 3.0
messages = ['230305', '230357', '230781']
nosy_count = 4.0
nosy_names = ['gpolo', 'python-dev', 'serhiy.storchaka', 'ddurrett']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue22769'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

@ddurrett
Copy link
Mannequin Author

ddurrett mannequin commented Oct 30, 2014

Have only tried this on Python 2.7

To reproduce:

from Tkinter import *
import ttk

```py
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 bpo-20072.

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

@ddurrett ddurrett mannequin added topic-tkinter type-bug An unexpected behavior, bug, or error labels Oct 30, 2014
@serhiy-storchaka serhiy-storchaka self-assigned this Oct 30, 2014
@serhiy-storchaka
Copy link
Member

Thank your for your report David.

Here is a patch which fixes the bug and adds tests for Treeview.tag_has().

@python-dev
Copy link
Mannequin

python-dev mannequin commented Nov 7, 2014

New changeset b3a5b53173c0 by Serhiy Storchaka in branch '2.7':
Issue bpo-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 bpo-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 bpo-22769: Fixed ttk.Treeview.tag_has() when called without arguments.
https://hg.python.org/cpython/rev/0b56adcb737d

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant