My python IDLE doesn't open anymore

I was changing some IDLE appearance settings when it crashed so I decided to restart it. From that moment on, IDLE has no longer opened.
It doesn’t give me any error messages it just won’t open.
I’ve used IDLE several times before.
Thanks in advance

If you changed them by hand-editing the .idlerc/config_xyz.cfg files, you might have made a mistake that prevents startup. Two things to do.

  1. Start IDLE in your OS command line Window, such as CommandPrompt on Windows, with (on Windows) py -m idlelib or equivalent on other systems. You might get an error message in the terminal window.
  2. Change the name of all .idlerc/*.cfg (easiest is to add a char to .cfg) so IDLE ignores them on startup.

“C:\Users\gaaet>py -m idlelib
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib_main
.py”, line 7, in
idlelib.pyshell.main()
File “C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib\pyshell.py”, line 1648, in main
shell = flist.open_shell()
^^^^^^^^^^^^^^^^^^
File “C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib\pyshell.py”, line 333, in open_shell
self.pyshell = PyShell(self)
^^^^^^^^^^^^^
File “C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib\pyshell.py”, line 897, in init
OutputWindow.init(self, flist, None, None)
File “C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib\outwin.py”, line 79, in init
EditorWindow.init(self, *args)
File “C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib\editor.py”, line 231, in init
self.set_width()
File “C:\Users\gaaet\AppData\Local\Programs\Python\Python311\Lib\idlelib\editor.py”, line 379, in set_width
self.width = pixel_width // zero_char_width
^^~~~~
ZeroDivisionError: integer division or modulo by zero"

I got this error in the CMD

I suspect you changed the font to one with an unusual bug. If so, which? Is it a font you installed? Also, what Python version?

And if so, the immediate fix is to revert that change. Edit C:\Users\gaaet\.idlerc\config-main.cfg and remove the 3 lines in the [EditorWindow] section that begin with font. If that leaves the section empty, remove the section name also. Restart IDLE and try another font.

This is the 2nd report I know of with this font bug. I mentioned this on that existing issue. This comment has a short tk test program. Can you run it with py and report the result?

1 Like