New submission from Terry J. Reedy <[email protected]>:
If one opens configdialog when there is no Shell and then hits OK, the dialog
fails to close. The following Squeezer-related traceback appears in associated
console when there is one.
Exception in Tkinter callback
Traceback (most recent call last):
File "F:\dev\3x\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
File "F:\dev\3x\lib\idlelib\configdialog.py", line 172, in ok
self.apply()
File "F:\dev\3x\lib\idlelib\configdialog.py", line 186, in apply
self.activate_config_changes()
File "F:\dev\3x\lib\idlelib\configdialog.py", line 240, in
activate_config_changes
klass.reload()
File "F:\dev\3x\lib\idlelib\squeezer.py", line 222, in reload
instance.load_font()
File "F:\dev\3x\lib\idlelib\squeezer.py", line 318, in load_font
Font(text, font=text.cget('font')).measure('0')
File "F:\dev\3x\lib\idlelib\delegator.py", line 10, in __getattr__
attr = getattr(self.delegate, name) # May raise AttributeError
AttributeError: 'NoneType' object has no attribute 'cget'
Either the squeezer instance should be destroyed and removed along with Shell
or, if keeping it is intentional, it should be removed from the update list and
reinstated or if not doing that is intentional, it must either check 'if text
is not None' before the access or catch the attribute error after. Tal, which?
----------
assignee: terry.reedy
components: IDLE
messages: 350281
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: OK sometimes fails to close configdialog
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37929>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com