diff --git a/Lib/argparse.py b/Lib/argparse.py index 02e98bbf920cf1..21c7b27bec3993 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -2455,7 +2455,7 @@ def parse_known_intermixed_args(self, args=None, namespace=None): # ======================== def _get_values(self, action, arg_strings): # for everything but PARSER, REMAINDER args, strip out first '--' - if action.nargs not in [PARSER, REMAINDER]: + if action.nargs not in [PARSER, REMAINDER, ZERO_OR_MORE, ONE_OR_MORE]: try: arg_strings.remove('--') except ValueError: diff --git a/Misc/NEWS.d/next/Library/2022-07-31-01-44-20.gh-issue-95468._4NAAA.rst b/Misc/NEWS.d/next/Library/2022-07-31-01-44-20.gh-issue-95468._4NAAA.rst new file mode 100644 index 00000000000000..919e0228a397b3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-31-01-44-20.gh-issue-95468._4NAAA.rst @@ -0,0 +1,2 @@ +Fixed an issue where multiple "--" arguments were not returned by +`ArgumentParser`. Pathch by Robert O'Shea