8000 gh-85308: argparse: Use filesystem encoding for arguments file by methane · Pull Request #93277 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-85308: argparse: Use filesystem encoding for arguments file #93277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update docs
  • Loading branch information
methane committed May 31, 2022
commit 6c6bffb31286e0d8b5f38c4d526ce068371659e6
7 changes: 3 additions & 4 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,9 @@ arguments will never be treated as file references.

.. versionchanged:: 3.12
:class:`ArgumentParser` changed encoding and errors to read arguments files
from default text encoding (e.g. :func:`locale.getpreferredencoding(False)`
and `"strict"`) to :term:`filesystem encoding and error handler`.
This change affects Windows; argument file should be encoded with UTF-8
instead of ANSI Codepage.
from default (e.g. :func:`locale.getpreferredencoding(False)` and
``"strict"``) to :term:`filesystem encoding and error handler`.
Arguments file should be encoded in UTF-8 instead of ANSI Codepage on Windows.


argument_default
Expand Down
9D14
3 changes: 1 addition & 2 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ Changes in the Python API
for reading arguments from file (e.g. ``fromfile_prefix_chars`` option)
from default text encoding (e.g. :func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`)
to :term:`filesystem encoding and error handler`.
Argument files should be encoded in UTF-8 instead of ANSI Codepage on Windows
unless :envvar:`PYTHONLEGACYWINDOWSFSENCODING` is set.
Argument files should be encoded in UTF-8 instead of ANSI Codepage on Windows.


Build Changes
Expand Down
0