FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] GH-54732: Tweak wording around empty lines in argument files (GH-150980) by miss-islington · Pull Request #151165 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 5 additions & 3 deletions Doc/library/argparse.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,8 @@ 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 that are read as arguments will result in an
"unrecognized arguments" error.
Each line is treated as a single argument, so an empty line is read as an
empty string (``''``).

:class:`ArgumentParser` uses :term:`filesystem encoding and error handler`
to read the file containing arguments.
Expand Down Expand Up @@ -2232,6 +2231,9 @@ Customizing file parsing
def convert_arg_line_to_args(self, arg_line):
return arg_line.split()

Note that with this override an argument can no longer contain spaces, since
each space-separated word becomes a separate argument.


Exiting methods
^^^^^^^^^^^^^^^
Expand Down
Loading

Back | FazBrowse Home | New Git URL