[Idle-dev] [ idlefork-Bugs-778547 ] UTF-8 mode files won't save with non-ASCII characters

SourceForge.net noreply at sourceforge.net
Tue Nov 25 00:08:30 EST 2003


Bugs item #778547, was opened at 2003-07-27 13:29
Message generated for change (Comment added) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109579&aid=778547&group_id=9579

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: UTF-8 mode files won't save with non-ASCII characters

Initial Comment:
Changing "Defaulr Source Encoding" to UTF-8 prevents 
error messages for files with "european characters" 
(ÄÖÜ). However the file will not save any longer...

Remove those characters and saving is o.k. again.
Michael Peuser

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

>Comment By: Kurt B. Kaiser (kbk)
Date: 2003-11-25 00:08

Message:
Logged In: YES 
user_id=149084

Ported loewis' fix: Python IDLE IOBinding.py 1.20, 1.21,
and fixed a typo in 1.21.

IOBinding 1.19

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

Comment By: Nobody/Anonymous (nobody)
Date: 2003-09-22 07:32

Message:
Logged In: NO 

I think bug #805728
(https://sourceforge.net/tracker/?func=detail&atid=105470&aid=805728&group_id=5470)
 should cover this case.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2003-08-03 10:10

Message:
Logged In: NO 

I found it happens only when editing existing files, not
when saving new ones.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2003-07-31 16:32

Message:
Logged In: NO 

I noticed the same problem with these characters (in my case
they were "à" and "è"").
Here is what I get in the shell, when trying to save from Idle:


>>> Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\PROGRA~1\Python23\lib\lib-tk\Tkinter.py", line
1345, in __call__
    return self.func(*args)
  File "C:\PROGRA~1\Python23\lib\idlelib\IOBinding.py", line
335, in save
    if self.writefile(self.filename):
  File "C:\PROGRA~1\Python23\lib\idlelib\IOBinding.py", line
370, in writefile
    chars = chars.replace("\n", self.eol_convention)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 365: ordinal not in range(128)


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109579&aid=778547&group_id=9579



More information about the IDLE-dev mailing list