[Python-bugs-list] [ python-Bugs-545600 ] IDLE doesn't save 8bit files

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Apr 2002 04:28:27 -0700


Bugs item #545600, was opened at 2002-04-18 13:28
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=545600&group_id=5470

Category: IDLE
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexandre Fayolle (afayolle)
Assigned to: Nobody/Anonymous (nobody)
Summary: IDLE doesn't save 8bit files

Initial Comment:
This bug seems to be related to #527022. 

Short version is: IDLE won't save files containing 8bit
characters (for instance in comments or in litteral
strings). No error dialog is displayed, only a
traceback on stderr or in the interactive window if
it's available:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.1/lib-tk/Tkinter.py", line
1285, in __call__
    return apply(self.func, args)
  File "/usr/lib/idle-python2.1/IOBinding.py", line
126, in save
    self.save_as(event)
  File "/usr/lib/idle-python2.1/IOBinding.py", line
136, in save_as
    if self.writefile(filename):
  File "/usr/lib/idle-python2.1/IOBinding.py", line
154, in writefile
    f.write(chars)
UnicodeError: ASCII encoding error: ordinal not in
range(128)

Possible solution:

 * at least warn the user that the file could not be
saved with an error dialog
 * try using the locale to guess the encoding and do
appropriate conversions
 * ask the user wich encoding should be used to save
the file

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=545600&group_id=5470