ThingamabobsCoding · GitHub

Bug report

Bug description:

Due to the naming convention in tkinter, which adds an prefix "!" to the widget name, there is an error dropped when using the name as a tag.
This would be easy to fix by just not adding signs that can be interpreted as logical expressions.
It would work more intuitively and I can't think of a scenario where a change in the naming convention would ruin someones day.

Thread on StackOverflow

import tkinter as tk
root = tk.Tk()
cnvs = tk.Canvas(root)
cnvs.pack()
labl = tk.Label(cnvs, text='hello world')
laid = cnvs.create_window(0,0,window=labl,anchor='nw', tags=str(labl))
tags = cnvs.gettags(laid)
cnvs.find_withtag(tags)
root.mainloop()

CPython versions tested on:

3.11

Operating systems tested on:

Windows

Linked PRs

Read the original on github.com ↗