(Answer adapted from comment with solution.) When starting up, IDLE accesses both its own files in Lib/idlelib
and user customization files in $HOME/.idlerc
. The latter are shared across all python/IDLE installations on the machine. The error message you got indicates that some file 'suddenly' became corrupted so that it was seen as mis-encoded. Since replacing the idlelib files did not fix the issue, the problem likely had to be in a .idlerc file. Your comment indicates that this must have been the case.
With no .idlerc present, IDLE will recreate one from scratch. Any customizations you had can be re-created with the options dialog. You can either delete the old version or try to poke around to retrieve some of the data.
I will look into adding something to the IDLE doc about .idlerc
corruption being a possible problem, and the solution.
EDIT: Bit can occasionally go bad on a hard disk, especially after several years. Has happened to me. To fix, only only needs to delete the bad file or file within .idlerc
if .idlerc
itself is not the problem. An IDLE error message may indicate which. Or one can try looking at each file in an editor for any obvious garbage.
Lib
, thenidlelib
, then try and openidle.pyw
. If not then tryidle.bat
. If still not then what happened even... – Hendricksonpython -i -m idlelib
. If nothing happens before you see a prompt, try>>> dir()
to see if anything was silently imported. If python itself will not run correctly, that would be your answer. You might also try running chkdsk (check disk), which you have to do as admin. Check web for how to on Win10. – DozierC: Users
on Win10) and if it is not completely empty change its name to, say, .idlerc-old. – Dozier