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: PEP 263 support in IDLE
Type: Stage:
Components: IDLE Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: gvanrossum, loewis
Priority: normal Keywords: patch

Created on 2002-08-04 23:56 by loewis, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
idle_263.txt loewis, 2002-08-04 23:56
Messages (3)
msg40833 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-08-04 23:56
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.
msg40834 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-08-05 14:36
Logged In: YES 
user_id=6380

This looks good. My only concerns are minor style issues:
importing several modules with one import statement, and two
unqualified except clauses that don't explain what can go
wrong (there's one that has extensive comments, that's good).
msg40835 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-08-05 15:08
Logged In: YES 
user_id=21627

I have corrected these problems, and committed the patch as

CallTips.py 1.10
IOBinding.py 1.8
PyShell.py 1.38
History
Date User Action Args
2022-04-10 16:05:33adminsetgithub: 36979
2002-08-04 23:56:33loewiscreate