[Python-bugs-list] [ python-Bugs-774680 ] Non-ASCII characters bugs

SourceForge.net noreply@sourceforge.net
Sun, 20 Jul 2003 16:05:30 -0700


Bugs item #774680, was opened at 2003-07-20 22:23
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774680&group_id=5470

Category: IDLE
Group: Python 2.3
Status: Open
Resolution: None
Priority: 7
Submitted By: Bartolomé Sintes Marco (barto)
Assigned to: Kurt B. Kaiser (kbk)
Summary: Non-ASCII characters bugs

Initial Comment:
I have downloaded and installed Python 2.3 RC1 in a
Spanish Windows 98 SE computer. IDLE 1.0 does not work
very well:

a) When I open with IDLE 1.0 RC1 a program written
with IDLE 0.8, Spanish non-ASCII characters (like
voyels with accents) are changed to wrong characters.
Some examples:
í -> á
ó -> ó
ú -> ú

b) With IDLE 1.0 rc1 I can create a new .py file with
non-ASCII characters and save it, but if I reload the
same file  and I modify it, then I can not save it
(neither save it as). If I delete the non-ASCII
characters, then I can save (or save it) without problems.

If you need more information my adress is
BartolomeSintes at ono.com

Thanks for your great work!

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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-07-21 01:05

Message:
Logged In: YES 
user_id=21627

rhettinger: In IDLE 1.0, IDLE should not ever refuse to safe
the file, unless the declared encoding (through the coding:
declaration) cannot support the characters in the file.

barto: I still don't understand what you did, either in case
a) or case b). Can you give precise data?

For a), please report what specific encoding you have put
into sitecustomize.py, what code page your windows
installation uses, and please attach a file that you have
created with IDLE 0.8.

For b), what do you mean by "save does not work"? Was there
some error message? If so, what did it say? If not, what
else was wrong.


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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-21 00:51

Message:
Logged In: YES 
user_id=80475

Part b) very closely resembles the problem I was having (and 
can no longer reproduce) in editting Doc/tut/tut.tex.

Something in the save procedure silently aborts the save if 
there is something it doesn't like in the file (encoding issues, 
sizes, name issues, python syntax highlighting issues, or 
somesuch).



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

Comment By: Bartolomé Sintes Marco (barto)
Date: 2003-07-21 00:47

Message:
Logged In: YES 
user_id=624347

bug a)
When I began to use IDLE 0.8, I could not use non-ASCII 
characters. As I read in http://www.python.org/cgi-
bin/faqw.py?
query=4.102&querytype=simple&casefold=yes&req=search I 
created a sitecustomize.py file in lib/site-packages and then I 
have been able to use non-ASCII characters (in IDLE 0.8) in 
my programs.
Now when I open these programs with IDLE 1.0rc1, it shows 
wrong non-ASCII characters (and yes, Notepad shows the 
same wrong characters). I thought it was a IDLE 1.0rc1 bug, 
but surely you are right and it is an 0.8 IDLE bug. The 
question is if there is an easy way to solve this problem 
(apart find and replace) and if it should be stated somewhere.

bug b)
You are right. IDLE 1.0rc1 shows a warning if the file is 
created with IDLE 1.0rc1. I made a mistake in my report. 
What I have done is opening with IDLE 1.0rc1 a file created 
with IDLE 0.8, deleting the non-ASCII characters and saving 
it. But if I add later some non-ASCII characters to this file 
with IDLE 1.0rc1, then save does not work (even if I manually 
add the # -*- coding: cp1252 -*- line) and it does not show 
any warning.

I think I have not changed the default configuration of IDLE 
1.0rc1 (Options/General/Default source encoding is set to 
none). I have not added the old sitecustomize.py to the 
Python 2.3rc1 installation .

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-07-20 23:10

Message:
Logged In: YES 
user_id=21627

Why do you think this is a bug in IDLE 1.0, when it is IDLE
0.8 which displays the data incorrectly? Can you report what
notepad.exe thinks about these files? Or better, can you
please attach one such file here?

Can you try adding a line
# -*- coding: iso-8859-1 -*-

as the first line of your file before saving it in IDLE, and
see whether this changes anything?

Did IDLE ever propose to add such a line?

Did you somehow change the default configuration of IDLE, 
through Options/Configure IDLE/General? Did you edit
site.py, or sitecustomize.py to change the default encoding`?

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

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