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.

Title: PEP 597: fileinput uses locale encoding
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.10
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: methane
Priority: normal Keywords: patch

Created on 2021-04-03 11:40 by methane, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25272 merged methane, 2021-04-08 03:31
Messages (2)
msg390121 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2021-04-03 11:40
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.
msg391032 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2021-04-14 05:13
New changeset 333d10cbb53dd5f28d76f659a49bf0735f8509d8 by Inada Naoki in branch 'master':
bpo-43712 : fileinput: Add encoding parameter (GH-25272)
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87878
2021-04-14 05:13:22methanesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-14 05:13:05methanesetmessages: + msg391032
2021-04-08 03:31:16methanesetkeywords: + patch
stage: patch review
pull_requests: + pull_request24007
2021-04-03 11:40:57methanecreate