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 597: fileinput uses locale encoding #87878

Closed
methane opened this issue Apr 3, 2021 · 2 comments
Closed

PEP 597: fileinput uses locale encoding #87878

methane opened this issue Apr 3, 2021 · 2 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir

Comments

@methane
Copy link
Member

methane commented Apr 3, 2021

BPO 43712
Nosy @methane
PRs
  • bpo-43712 : fileinput: Add encoding parameter #25272
  • 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 = None
    closed_at = <Date 2021-04-14.05:13:22.022>
    created_at = <Date 2021-04-03.11:40:57.640>
    labels = ['library', '3.10']
    title = 'PEP 597: fileinput uses locale encoding'
    updated_at = <Date 2021-04-14.05:13:22.021>
    user = 'https://github.com/methane'

    bugs.python.org fields:

    activity = <Date 2021-04-14.05:13:22.021>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-04-14.05:13:22.022>
    closer = 'methane'
    components = ['Library (Lib)']
    creation = <Date 2021-04-03.11:40:57.640>
    creator = 'methane'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43712
    keywords = ['patch']
    message_count = 2.0
    messages = ['390121', '391032']
    nosy_count = 1.0
    nosy_names = ['methane']
    pr_nums = ['25272']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43712'
    versions = ['Python 3.10']

    @methane
    Copy link
    Member Author

    methane commented Apr 3, 2021

    fileinput.input() and fileinput.FileInput() don't have encoding parameter.

    User can specify encoding by openhook=hook_encoded("utf-8"). But we can not utilize PEP-597, and encoding="utf-8" is more user friendly.

    Additionally, hook_compressed doesn't have the encoding parameter. User need to use binary mode or locale encoding.

    @methane methane added 3.10 only security fixes stdlib Python modules in the Lib dir labels Apr 3, 2021
    @methane
    Copy link
    Member Author

    methane commented Apr 14, 2021

    New changeset 333d10c by Inada Naoki in branch 'master':
    bpo-43712 : fileinput: Add encoding parameter (GH-25272)
    333d10c

    @methane methane closed this as completed Apr 14, 2021
    @methane methane closed this as completed Apr 14, 2021
    @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 stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant