[Patches] [ python-Patches-1061803 ] Source code encoding in IDLE console
SourceForge.net
noreply at sourceforge.net
Thu Jul 20 21:36:00 CEST 2006
Patches item #1061803, was opened at 2004-11-07 03:19
Message generated for change (Settings changed) made by kbk
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1061803&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: Python 2.5
Status: Open
Resolution: None
>Priority: 4
Submitted By: Hye-Shik Chang (perky)
>Assigned to: Martin v. Löwis (loewis)
Summary: Source code encoding in IDLE console
Initial Comment:
Source code encoding is ignored in IDLE console
sessions currently. To allow to use encodings other
than Latin-1, encoding marker must be added before
passing it to tokenizers. (see the attached patch)
current behavior:
>>> u'한글'
u'\xc7\xd1\xb1\xdb'
this must be like ...
>>> u'한글'
u'\ud55c\uae00'
----------------------------------------------------------------------
Comment By: Hye-Shik Chang (perky)
Date: 2004-11-07 08:01
Message:
Logged In: YES
user_id=55188
Surprisingly, it doesn't affect source code lines. But, I'm
still wondering why it isn't counted as a distinct line. :)
>>> raise ValueError
Traceback (most recent call last):
File "<pyshell#3>", line 1, in -toplevel-
raise ValueError
ValueError
>>> if 1:
pass
raise ValueError
Traceback (most recent call last):
File "<pyshell#9>", line 3, in -toplevel-
raise ValueError
ValueError
Okay. I agree that it's too late to change behavior, but it
may need to write some errata item about this inconsistency
of IDLE vs terminal interactive mode on documentation.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2004-11-07 05:20
Message:
Logged In: YES
user_id=21627
I think the patch is wrong, as it messes with the source
code typed. At a minimum, line number will be off by one, no?
I'm currently working on a different solution, allowing
compile() to accept an encoding. However, it is too late to
add this to 2.4 now.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1061803&group_id=5470
More information about the Patches
mailing list