Edit : adding "import io" in iomenu.py fixed the problem indeed. Thanks a lot Terry!
Original: Like the title said : I'm using IDLE (Windows) to write scripts in python, but it won't save (ctrl+s, manual save, or the save at exit). It doesn't freeze or crash, it just doesn't save (I can tell by the * before the name of the file on the windows title). After some tries I realized that it happens only when I'm using letters with diacritics in the text (I'm French so it will be éèêàç...). As soon as I change the letters, I can save again, and therefore run the script. Notepad or the python shell still work fine.
Things that don't work :
# -*- coding: UTF-8 -*-
I started coding only ten days ago so I'm still a newb but I guess this has something to do with encoding? It might be related to the new 3.8.4 update as it worked fine until today. I'm working on Windows 10 64 bit.
Thanks!
Either a) add import io
to the top of <pythondir>/idlelib/iomenu.py
, or b) get 3.8.5, released today with hot fixes to multiple problems in 3.8.4, including this one. Same answer applies to 3.9.0b4 versus 3.9.0b5, also released today.
EDIT: In 3.8.5 and 3.9.0b5 there remains another issue with respect to save failing and line endings when editing files created outside of IDLE. iomenu.py, line 251, is currently
if self.eol_convention != "\n":
Change it to
if isinstance(self.eol_convention, str) and self.eol_convention != "\n":
EDIT 2: 3.8.6, and 3.9.0, both recently released, fix both issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With