[issue43712] PEP 597: fileinput uses locale encoding

Inada Naoki report at bugs.python.org
Sat Apr 3 07:40:57 EDT 2021


New submission from Inada Naoki <songofacandy at gmail.com>:

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.

----------
components: Library (Lib)
messages: 390121
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: fileinput uses locale encoding
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43712>
_______________________________________


More information about the Python-bugs-list mailing list