argparse: space in an incorrect argument adds it to nargs="*"
, instead of raising an error
#114429
Labels
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
Code to recreate:
Current behaviour:
If the wrong argument contains a space, it is added to the catch-all arguments:
But if it doesn't contain a space, expected behaviour happens:
Expected behaviour:
Calling this program as
bug.py --wrong-argument="foo bar"
prints an error message:CPython versions tested on:
3.11
Operating systems tested on:
No response
The text was updated successfully, but these errors were encountered: