classification
Title: IDLE: OK sometimes fails to close configdialog
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: miss-islington, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2019-08-23 13:27 by terry.reedy, last changed 2019-08-25 06:25 by taleinat. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15452 merged taleinat, 2019-08-24 08:17
PR 15484 merged miss-islington, 2019-08-25 05:53
PR 15485 merged miss-islington, 2019-08-25 05:53
Messages (6)
msg350281 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-08-23 13:27
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?
msg350356 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-08-24 08:19
See PR GH-15452 with a fix.
msg350428 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-08-25 05:53
New changeset d4b4c00b57d24f6ee2cf3a96213406bb09953df3 by Tal Einat in branch 'master':
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
https://github.com/python/cpython/commit/d4b4c00b57d24f6ee2cf3a96213406bb09953df3
msg350430 - (view) Author: miss-islington (miss-islington) Date: 2019-08-25 06:17
New changeset f2b468dd6d0bdbe2e87c0ca7515800a115e95e54 by Miss Islington (bot) in branch '3.7':
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
https://github.com/python/cpython/commit/f2b468dd6d0bdbe2e87c0ca7515800a115e95e54
msg350431 - (view) Author: miss-islington (miss-islington) Date: 2019-08-25 06:18
New changeset e266d062e017b122b9741db2bd5fb99742378623 by Miss Islington (bot) in branch '3.8':
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
https://github.com/python/cpython/commit/e266d062e017b122b9741db2bd5fb99742378623
msg350433 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-08-25 06:25
Fixed.
History
Date User Action Args
2019-08-25 06:25:32taleinatsetstatus: open -> closed
resolution: fixed
messages: + msg350433

stage: patch review -> resolved
2019-08-25 06:18:04miss-islingtonsetmessages: + msg350431
2019-08-25 06:17:23miss-islingtonsetnosy: + miss-islington
messages: + msg350430
2019-08-25 05:53:47miss-islingtonsetpull_requests: + pull_request15172
2019-08-25 05:53:11miss-islingtonsetpull_requests: + pull_request15171
2019-08-25 05:53:01taleinatsetmessages: + msg350428
2019-08-24 08:19:11taleinatsetmessages: + msg350356
2019-08-24 08:17:27taleinatsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request15144
2019-08-23 13:27:44terry.reedycreate