[New-bugs-announce] [issue13179] IDLE uses common tkinter variables across all editor windows

Roger Serwy report at bugs.python.org
Fri Oct 14 17:52:28 CEST 2011

New submission from Roger Serwy <roger.serwy at gmail.com>:

IDLE's EditorWindow.py relies on using FileList.py's "vars" dictionary to store Tkinter variables instead of using its own. As a consequence, 
toggling a checked menu item in one editor window toggles the menu item in ALL editor windows.

To reproduce this error, open two editor windows with Code Context initially disabled. Enable Code Context in one window and then click "Options" in the other. You'll see Code Context checked when it shouldn't be.

Attached is a patch to fix this problem. It causes EditorWindow to have its own dictionary for handling these Tkinter variables instead of using the flist's "vars". The comment in FileList.py suggests that this design is a relic from an old version of IDLE, since getrawvar is no longer a function.

    self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)

components: IDLE
files: patch_EditorWindow.diff
keywords: patch
messages: 145539
nosy: serwy
priority: normal
severity: normal
status: open
title: IDLE uses common tkinter variables across all editor windows
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file23406/patch_EditorWindow.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list