This looks like a problem specific to IDLE.
There are several issues on the python bug tracker that are closely related (e.g. 8093 and 12540), but they are now closed and resolved as "fixed".
Since it appears that you are using a very old version of python (2.5), you should be able to solve the problem by upgrading.