[Idle-dev] Bug report for idle : problems with file save and unicode

Cadet Alain alain.cadet@insee.fr
Fri, 9 May 2003 09:32:59 +0200


On windows NT4 with a French installation (cp850), I get sometimes some
problems when I try to save a file.
I get an error and after :
1) it is impossible to save the file
2) the previous file is lost (file with 0K and nothing inside)
I got this several times. I notice nothing special except that the files
have special characters in strng values (ascii >128).

Here is the error message :

Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32

Exception in Tkinter callback
Traceback (most recent call last):
  File "D:\Python22\lib\lib-tk\Tkinter.py", line 1292, in __call__
    return apply(self.func, args)
  File "D:\Python22\Tools\idle\EditorWindow.py", line 495, in close
    reply = self.maybesave()
  File "D:\Python22\Tools\idle\EditorWindow.py", line 490, in maybesave
    return self.io.maybesave()
  File "D:\Python22\Tools\idle\IOBinding.py", line 118, in maybesave
    self.save(None)
  File "D:\Python22\Tools\idle\IOBinding.py", line 128, in save
    if self.writefile(self.filename):
  File "D:\Python22\Tools\idle\IOBinding.py", line 154, in writefile
    f.write(chars)
UnicodeError: ASCII encoding error: ordinal not in range(128)