Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 263 support in IDLE #36979

Closed
loewis mannequin opened this issue Aug 4, 2002 · 3 comments
Closed

PEP 263 support in IDLE #36979

loewis mannequin opened this issue Aug 4, 2002 · 3 comments
Assignees

Comments

@loewis
Copy link
Mannequin

loewis mannequin commented Aug 4, 2002

BPO 590913
Nosy @gvanrossum, @loewis
Files
  • idle_263.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/loewis'
    closed_at = <Date 2002-08-05.15:08:12.000>
    created_at = <Date 2002-08-04.23:56:33.000>
    labels = ['expert-IDLE']
    title = 'PEP 263 support in IDLE'
    updated_at = <Date 2002-08-05.15:08:12.000>
    user = 'https://github.com/loewis'

    bugs.python.org fields:

    activity = <Date 2002-08-05.15:08:12.000>
    actor = 'loewis'
    assignee = 'loewis'
    closed = True
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2002-08-04.23:56:33.000>
    creator = 'loewis'
    dependencies = []
    files = ['4480']
    hgrepos = []
    issue_num = 590913
    keywords = ['patch']
    message_count = 3.0
    messages = ['40833', '40834', '40835']
    nosy_count = 2.0
    nosy_names = ['gvanrossum', 'loewis']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue590913'
    versions = []

    @loewis
    Copy link
    Mannequin Author

    loewis mannequin commented Aug 4, 2002

    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.

    @loewis loewis mannequin closed this as completed Aug 4, 2002
    @loewis loewis mannequin self-assigned this Aug 4, 2002
    @loewis loewis mannequin added the topic-IDLE label Aug 4, 2002
    @loewis loewis mannequin closed this as completed Aug 4, 2002
    @loewis loewis mannequin self-assigned this Aug 4, 2002
    @loewis loewis mannequin added the topic-IDLE label Aug 4, 2002
    @gvanrossum
    Copy link
    Member

    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).

    @loewis
    Copy link
    Mannequin Author

    loewis mannequin commented Aug 5, 2002

    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant