IDLE : Saving script problems

v.wehren v.wehren at
Sun Oct 6 13:00:17 CEST 2002

Are you using any french characters (cedilla, accents) and so on in your
comments? Be aware that your build propably defaults to ASCII as encoding
for your code!

The trick used to be adapting your "" in the pythin22\lib directory.
Find "encoding" (ca. line 288). Try changing "ASCII" to "CP1252".

It's possible that this method is depracated, but it worked fine for me...


"ray" <raynaldo.delporte at> schrieb im Newsbeitrag
news:3da0114c$0$6939$79c14f64 at
> Hi !
> I'm a beginner in Python. Using XP.
> When starting the Python Shell, creating a new window with CTRL-N, and
> writing some script, i CANNOT save it !!!
> when saving, the Python Shell main window displays an error message in RED
> >>> Exception in Tkinter callback
> Traceback (most recent call last):
>   File "C:\Python22\lib\lib-tk\", line 1292, in __call__
>     return apply(self.func, args)
>   File "C:\PYTHON22\Tools\idle\", line 126, in save
>     self.save_as(event)
>   File "C:\PYTHON22\Tools\idle\", line 136, in save_as
>     if self.writefile(filename):
>   File "C:\PYTHON22\Tools\idle\", line 154, in writefile
>     f.write(chars)
> UnicodeError: ASCII encoding error: ordinal not in range(128)
> How can i fix this problem ???
> Thanx.

More information about the Python-list mailing list