[New-bugs-announce] [issue41136] argparse uses default encoding when read arguments from file

Serhiy Storchaka report at bugs.python.org
Sat Jun 27 03:13:47 EDT 2020


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

The fromfile_prefix_chars option allows you to read arguments from file. But open() without explicit encoding is used for this. Therefore the result is depending on the current locale or the PYTHONIOENCODING environment variable. On Linux this is rare a problem, because UTF-8 is a common locale encoding, but on Windows the locale encoding is usually 8-bit and may even be not able to encode all file names.

I think we need a new option to specify the encoding for files from which arguments are read.

----------
components: Library (Lib)
messages: 372452
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: argparse uses default encoding when read arguments from file
type: enhancement
versions: Python 3.10

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


More information about the New-bugs-announce mailing list