Steps for reproduction: 1. Open a new code window 2. Enter python code which contains a syntax error 3. F5 and attempt to run the file (This was done without saving first) 4. Close the syntax error dialog. 5. Fix the syntax error and try to F5 again without saving again. 6. IDLE will encounter an error and unexpectedly close. I'm reporting this after having tested this on 4 different OSX 10.5.8 machines. I'm not sure if other versions of Python are also susceptible to this as well.
Following your test case, I am able to produce a deadlocked IDLE when using the python.org 3.1.2 OS X installer on 10.5.8 when using just the Apple-supplied Tk 8.4 framework. After installing a recent ActiveState Tcl/Tk 8.4 framework (the python.org installers are built to dynamically link with either), the hang is no longer reproducible. There doesn't seem to be a problem with either 2.6.6 or 2.7, with either version of Tcl/Tk, nor is there on 10.6 but the Apple-supplied 8.4 there is much newer than that in 10.5. I'm doing some more triage work on this issue with 3.1 and 3.2. In the interim, a workaround may be to install the ActiveState Tcl/Tk 8.4 on your systems if that is acceptable.
IDLE from the Python 3.2a2 OS X installer exhibits the same buggy behavior on 10.5 as 3.1.2 (hangs with system Tk 8.4, OK with ActiveState Tk 8.4). There also seem to be some unexpected differences in IDLE behavior between 2.7 and 3.x as if some changes were not backported. Will triage further.
Adding the nosy list from Issue6628 where this problem was originally reported. What's interesting about this is that IDLE 2.x does not exhibit this behavior, AFAICT, when using the same Apple Tk 8.4. As there are other odd behaviors with IDLE 3.x on OS X, I want to investigate this further.
The problem was caused by a minor change in IDLE during the port of IDLE from 2.x to 3.x. It is fixed by the changes for Issue11053: r88234 (3.2rc2) and r88242 (planned for 3.1.4).