[issue39171] Missing default root in tkinter simpledialog.py

Dominic Mayers report at bugs.python.org
Tue Dec 31 09:44:00 EST 2019


Dominic Mayers <dominic_mayers at yahoo.com> added the comment:

If it's normal, then the error message should perhaps be more informative and user friendly than just a traceback: 

    Traceback (most recent call last):
      File "./dialog.py", line 6, in <module>
        integer_value = simpledialog.askinteger('Dialog Title', 'What is your age?', minvalue=0, maxvalue=100)
      File "/usr/lib/python3.7/tkinter/simpledialog.py", line 341, in askinteger
        d = _QueryInteger(title, prompt, **kw)
      File "/usr/lib/python3.7/tkinter/simpledialog.py", line 271, in __init__
        Dialog.__init__(self, parent, title)
      File "/usr/lib/python3.7/tkinter/simpledialog.py", line 137, in __init__
        if parent.winfo_viewable():
    AttributeError: 'NoneType' object has no attribute 'winfo_viewable'

If it is not too intrusive, it would be even more user friendly if the code found some parent window.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39171>
_______________________________________


More information about the Python-bugs-list mailing list