Skip to content

gh-54732: Make argparse error caused by empty rows in option files explicit #136795

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 6 commits into from
Jul 19, 2025
Merged
Changes from 2 commits
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
6 changes: 6 additions & 0 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ were in the same place as the original file referencing argument on the command
line. So in the example above, the expression ``['-f', 'foo', '@args.txt']``
is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar']``.

.. note::

Empty lines are treated as empty strings (''), which are allowed as values but not
as arguments. Empty lines as arguments will result in an “unrecognized arguments”
error.

:class:`ArgumentParser` uses :term:`filesystem encoding and error handler`
to read the file containing arguments.

Expand Down
Loading