You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
font.Font.__init__, font.families, and font.names have a 'root=None' argument and start with
if not root:
root = tkinter._default_root
But font.nametofont does not, and so it calls Font without passing a root argument:
return Font(name=name, exists=True)
Font fails if there is no default root. There cannot be one if, as recommended, one disables it.
importtkinterastkfromtkinterimportfonttk.NoDefaultRoot()
root=tk.Tk()
font.nametofont('TkFixedFont')
# AttributeError: module 'tkinter' has no attribute '_default_root'
Proposed fix: add 'root=None' parameter to nametofont (at end, to not break code) and 'root=root' to Font call.
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: