File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -415,12 +415,18 @@ arguments they contain. For example::
415415 >>> parser.parse_args(['-f', 'foo', '@args.txt'])
416416 Namespace(f='bar')
417417
418- Arguments read from a file must by default be one per line (but see also
418+ Arguments read from a file must be one per line by default (but see also
419419:meth: `~ArgumentParser.convert_arg_line_to_args `) and are treated as if they
420420were in the same place as the original file referencing argument on the command
421421line. So in the example above, the expression ``['-f', 'foo', '@args.txt'] ``
422422is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar'] ``.
423423
424+ .. note ::
425+
426+ Empty lines are treated as empty strings (``'' ``), which are allowed as values but
427+ not as arguments. Empty lines that are read as arguments will result in an
428+ "unrecognized arguments" error.
429+
424430:class: `ArgumentParser ` uses :term: `filesystem encoding and error handler `
425431to read the file containing arguments.
426432
You can’t perform that action at this time.
0 commit comments