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

IDLE: rewrite the code for handling file encoding #85330

Closed
serhiy-storchaka opened this issue Jun 29, 2020 · 7 comments
Closed

IDLE: rewrite the code for handling file encoding #85330

serhiy-storchaka opened this issue Jun 29, 2020 · 7 comments
Assignees
Labels
3.10 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 41158
Nosy @terryjreedy, @serhiy-storchaka, @miss-islington
PRs
  • bpo-41158: IDLE: rewrite the code for handling file encoding #21215
  • [3.8] bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215) #21259
  • [3.9] bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215) #21260
  • [3.8] bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215) #21267
  • 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/terryjreedy'
    closed_at = <Date 2020-06-30.06:48:59.410>
    created_at = <Date 2020-06-29.11:37:57.258>
    labels = ['expert-IDLE', 'type-feature', '3.10']
    title = 'IDLE: rewrite the code for handling file encoding'
    updated_at = <Date 2020-07-15.04:16:06.997>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-07-15.04:16:06.997>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2020-06-30.06:48:59.410>
    closer = 'serhiy.storchaka'
    components = ['IDLE']
    creation = <Date 2020-06-29.11:37:57.258>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41158
    keywords = ['patch']
    message_count = 7.0
    messages = ['372563', '372659', '372686', '372736', '372759', '372780', '373666']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['21215', '21259', '21260', '21267']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue41158'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    The proposed patch rewrites the code in IDLE for detecting Python file encoding and decoding and encoding Python sources by using the tokenize module instead of handmade implementation of PEP-263.

    @serhiy-storchaka serhiy-storchaka added the 3.10 only security fixes label Jun 29, 2020
    @serhiy-storchaka serhiy-storchaka added topic-IDLE type-feature A feature request or enhancement 3.10 only security fixes labels Jun 29, 2020
    @serhiy-storchaka serhiy-storchaka added topic-IDLE type-feature A feature request or enhancement labels Jun 29, 2020
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 694d31e by Serhiy Storchaka in branch 'master':
    bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
    694d31e

    @terryjreedy
    Copy link
    Member

    Is there any reason the patch would not work with 3.9/3.8?

    @serhiy-storchaka
    Copy link
    Member Author

    No, it can be backported to 3.8 and 3.9 if you wish.

    @miss-islington
    Copy link
    Contributor

    New changeset fe0175f by Miss Islington (bot) in branch '3.9':
    bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
    fe0175f

    @miss-islington
    Copy link
    Contributor

    New changeset c3fa753 by Miss Islington (bot) in branch '3.8':
    bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
    c3fa753

    @terryjreedy
    Copy link
    Member

    bpo-41300 reports that the new iomenu line 291
    enc, _ = tokenize.detect_encoding(io.BytesIO(encoded).readline)
    fails without 'import io' added. I should have tested more thoroughly. I will fix and add tests there.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants