[Patches] [ python-Patches-590913 ] PEP 263 support in IDLE

noreply@sourceforge.net noreply@sourceforge.net
Sun, 04 Aug 2002 16:56:33 -0700


Patches item #590913, was opened at 2002-08-05 01:56
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=590913&group_id=5470

Category: IDLE
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Guido van Rossum (gvanrossum)
Summary: PEP 263 support in IDLE

Initial Comment:
This patch adds the notion of encodings to IDLE. In
particular:

- it tries to determine the locale's encoding (falling
back to ASCII if that fails, or no codec is found)

- looks for PEP 263 encoding specs when reading and
writing files (producing errors when the encoding spec
is wrong)

- produces error dialogs when new files have non-ASCII,
but no declared encoding

- assumes the locale's encoding when a non-ASCII file
is opened, uses the same encoding when the file is
later saved again,

- falls back to letting Tcl deal with decoding when
decoding fails,

- falls back to saving as UTF-8 when encoding fails (so
perhaps the errors should all be infos instead)

- applies the locale's encoding in the interactive
window. This is not a violation of PEP 263, instead, it
just changes  the encoding of the interactive shell
from "unicode" to the locale's encoding - probably
similar to what all other terminals do.

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

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