[New-bugs-announce] [issue31493] IDLE cond context: fix code update and font update timers

Terry J. Reedy report at bugs.python.org
Sat Sep 16 16:47:15 EDT 2017


New submission from Terry J. Reedy:

1. Currently, each instance of codecontext.CodeContext creates 2 root.after loops.  There should be at most two loops for the class, and preferably fewer by using the new reload().

2. The loops are never explicitly shut down.  Since conversion to a feature,  the following appears after running test_idle.

.invalid command name "109891384timer_event"
    while executing
"109891384timer_event"
    ("after" script)
invalid command name "109891512font_timer_event"
    while executing
"109891512font_timer_event"
    ("after" script)

This is because of
  File "F:\dev\3x\lib\idlelib\idle_test\test_outwin.py", line 20, in setUpClass
    w = cls.window = outwin.OutputWindow(None, None, None, root)
  File "F:\dev\3x\lib\idlelib\outwin.py", line 78, in __init__
    EditorWindow.__init__(self, *args)
  File "F:\dev\3x\lib\idlelib\editor.py", line 319, in __init__
  text.bind("<<toggle-code-context>>",  # added to traceback
    self.CodeContext(self).toggle_code_context_event)

The statement, which creates an instance, was added as part of the conversion.  However, the outwin tests were merged a week before the conversion, so this message might have started the.  In any case, editor.EditorWindow.load_extension does the same thing in doing the binding.  It is not clear why there is no message from other editor-creating tests. 

I want to fix at least this before next Monday's cutoff for new releases.  I will first try is after_cancel in a __del__ method.

----------
assignee: terry.reedy
components: IDLE
messages: 302352
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE cond context: fix code update and font update timers
type: behavior
versions: Python 3.6, Python 3.7

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


More information about the New-bugs-announce mailing list