classification
Title: PEP 597: fileinput uses locale encoding
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
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 2021-04-14 05:13 by methane. 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)
https://github.com/python/cpython/commit/333d10cbb53dd5f28d76f659a49bf0735f8509d8
History
Date User Action Args
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