This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Source code encoding in IDLE console
Type: Stage:
Components: IDLE Versions: Python 2.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: kbk Nosy List: hyeshik.chang, kbk, loewis
Priority: low Keywords: patch

Created on 2004-11-07 08:19 by hyeshik.chang, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
idle-i18n.diff hyeshik.chang, 2004-11-07 08:19 a patch to allow to use non-latin-1 encodings in IDLE session.
Messages (5)
msg47224 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2004-11-07 08:19
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'
msg47225 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-11-07 10:20
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.
msg47226 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2004-11-07 13:01
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.
msg59027 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-12-28 18:28
Can this be closed? Is it still an issue in 3.0?
msg62438 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-02-15 20:32
No response from OP, closing.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41134
2008-02-15 20:42:22kbksetstatus: open -> closed
2008-02-15 20:32:44kbksetassignee: loewis -> kbk
resolution: rejected
messages: + msg62438
2007-12-28 18:28:15kbksetnosy: + kbk
messages: + msg59027
2004-11-07 08:19:47hyeshik.changcreate