Title: Setting font from preference dialog in IDLE on OS X broken
Type: behavior Stage: test needed
Components: IDLE Versions: Python 3.0, Python 3.1
Status: closed Resolution: later
Dependencies: Superseder: Patch for IDLE/OS X to work with Tk-Cocoa
View: 6075
Assigned To: kbk Nosy List: MLModel, bmiller, gpolo, kbk, ned.deily, wordtech
Priority: normal Keywords: patch

Created on 2009-02-12 22:08 by MLModel, last changed 2009-05-21 01:40 by kbk. This issue is now closed.

Messages (7)
msg81827 - (view) Author: Mitchell Model (MLModel) Date: 2009-02-12 22:08
When setting the font in IDLE's Preferences dialog on OSX, having 
started IDLE from the command line, the font is changed and the 
following is printed:

Exception in Tkinter callback
Traceback (most recent call last):
/", line 1399, in __call__
    return self.func(*args)
/", line 1125, in Ok
/", line 1129, in Apply
/", line 1107, in DeactivateCurrentConfig
    winInstances = self.parent.instance_dict.keys()
/", line 1708, in __getattr__
    return getattr(, attr)
AttributeError: 'tkapp' object has no attribute 'instance_dict'
msg81835 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-02-12 22:56
FWIW, I am not able to reproduce this using a release3.0 IDLE (so with 
today's patches) built with the default Apple-supplied Tcl/Tk in 10.5.  
Are you using a newer Tcl/Tk?  Does it happen if you move your current 
preferences out of ~/.idlerc?
msg81857 - (view) Author: Mitchell Model (MLModel) Date: 2009-02-13 02:59
At 10:56 PM +0000 02/12/09, Ned Deily wrote:
>Ned Deily <> added the comment:
>FWIW, I am not able to reproduce this using a release3.0 IDLE (so with
>today's patches) built with the default Apple-supplied Tcl/Tk in 10.5. 
>Are you using a newer Tcl/Tk?  Does it happen if you move your current
>preferences out of ~/.idlerc?

It does still happen if I move my preferences. And move my
I did build it with a newer Tk -- 8.5 installed as a Framework.
(And I switched the order of /System/Library/Frameworks and /Library/Frameworks,
which makes more sense. I thought I had seen that as an Issue, but it must have been
just a web page where I saw it. Similarly, I added /opt/local/lib and /opt/local/include
in detect_modules before the directories that are added, so that it finds the readline I
installed with "port".)

So, I started again with a fresh checkout. I didn't switch the order of the Frameworks
directories, and I tried it with and without the directories for readline. I started Python
manually, imported Tk, checked it's version, etc. to confirm I was getting the Apple
installation.  If I try to run bin/idle from the 3.1 Frameworks version directory
I get a segmentation fault. I've seen a lot of weird behavior over the years in my
many configuration and installation escapades across a wide variety of software,
but I've never seen a seg fault with anything to do with Python.  I have the "do you
want to report this" backtrace if you're interested. A little later I'll try this from scratch
on a clean, though PowerPC (G4), machine and see what happens.
msg81871 - (view) Author: Mitchell Model (MLModel) Date: 2009-02-13 04:02
OK, so I built 3.1 on a clean (G4) system instead of my highly 
tangled Intel and didn't get the seg fault. I guess the issue isn't 
msg83732 - (view) Author: Brad Miller (bmiller) Date: 2009-03-18 02:21
I get the same problem when I try to change the key set.  This is on on 
intel build using Tk 8.5, and the latest 3.1 source checked out with 

I too changed the order of /Library/Frameworks and 
/System/Library/Frameworks in

A simple fix for me was to add the line

root.instance_dict = {}

in  That does not seem to have any other ill effects.
msg88147 - (view) Author: Kevin Walzer (wordtech) * Date: 2009-05-21 00:59
Added Brad's snippet to see
msg88148 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2009-05-21 01:40
Superceeded by 6075.
Date User Action Args
2009-05-21 01:40:36kbksetstatus: open -> closed

superseder: Patch for IDLE/OS X to work with Tk-Cocoa
assignee: kbk

nosy: + kbk
messages: + msg88148
resolution: later
2009-05-21 00:59:05wordtechsetnosy: + wordtech
messages: + msg88147
2009-04-26 22:21:20ajaksu2setnosy: + gpolo
priority: normal
keywords: + patch
type: behavior
stage: test needed
2009-03-18 02:21:21bmillersetnosy: + bmiller
messages: + msg83732
2009-02-13 04:02:57MLModelsetmessages: + msg81871
2009-02-13 02:59:03MLModelsetmessages: + msg81857
2009-02-12 22:56:51ned.deilysetnosy: + ned.deily
messages: + msg81835
2009-02-12 22:08:25MLModelcreate