This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kapsh
Recipients Endre, berker.peksag, bethard, kapsh, paul.j3, xiang.zhang
Date 2019-07-07.10:14:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562494489.92.0.819086292076.issue26952@roundup.psfhosted.org>
In-reply-to
Content
I have a feeling that nesting groups has nothing to do with it. Got same traceback when I forgot to fill my mutually exclusive groups with arguments. 

import argparse

parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
parser.parse_args(['-h'])

# Result:

Traceback (most recent call last):
  File "/home/kapsh/.PyCharmCE2019.1/config/scratches/scratch_12.py", line 5, in <module>
    parser.parse_args(['-h'])
  File "/usr/lib/python3.7/argparse.py", line 1749, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 1781, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 1987, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.7/argparse.py", line 1927, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.7/argparse.py", line 1855, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.7/argparse.py", line 1037, in __call__
    parser.print_help()
  File "/usr/lib/python3.7/argparse.py", line 2474, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/lib/python3.7/argparse.py", line 2458, in format_help
    return formatter.format_help()
  File "/usr/lib/python3.7/argparse.py", line 284, in format_help
    help = self._root_section.format_help()
  File "/usr/lib/python3.7/argparse.py", line 215, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.7/argparse.py", line 215, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.7/argparse.py", line 322, in _format_usage
    action_usage = format(optionals + positionals, groups)
  File "/usr/lib/python3.7/argparse.py", line 397, in _format_actions_usage
    start = actions.index(group._group_actions[0])
IndexError: list index out of range
History
Date User Action Args
2019-07-07 10:14:49kapshsetrecipients: + kapsh, bethard, berker.peksag, paul.j3, xiang.zhang, Endre
2019-07-07 10:14:49kapshsetmessageid: <1562494489.92.0.819086292076.issue26952@roundup.psfhosted.org>
2019-07-07 10:14:49kapshlinkissue26952 messages
2019-07-07 10:14:49kapshcreate