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: argparse uses default encoding when read arguments from file
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.10
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, paul.j3, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-06-27 07:13 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 21444 open ZackerySpytz, 2020-07-11 12:13
Messages (1)
msg372452 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-06-27 07:13
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.
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85308
2020-07-11 12:13:17ZackerySpytzsetkeywords: + patch
nosy: + ZackerySpytz

pull_requests: + pull_request20592
stage: patch review
2020-06-28 20:06:57paul.j3setnosy: + paul.j3
2020-06-27 07:14:37serhiy.storchakalinkissue41063 dependencies
2020-06-27 07:13:47serhiy.storchakacreate