[issue26952] argparse help formatter crashes

2016-05-04 Thread Endre

Endre added the comment:

Hi,

Thanks for taking a look at it.
I have only tried it with argparse-1.4.0.

"I don't think add_mutually_exclusive_group and add_argument_group are designed 
to work together."

Yes, it really works strange in this case. I guess the framework should raise 
an exception which states that this use case is not supported, e.g. at the 
"serverGroup = mutexGroup.add_argument_group('serverGroup')
" line.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26952>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26952] argparse help formatter crashes

2016-05-04 Thread Endre

New submission from Endre:

I am using argparse-1.4.0.

For this code exception is thrown when the script is started with the -h option:
http://pastebin.com/dFF1paFA

This exception is thrown:
Traceback (most recent call last):
  File "C:\Users\ebak\Picea\tools\buildsystem\python\kw_set_checkers.py", line 
129, in 
args = parser.parse_args()
  File "C:\Python27\lib\argparse.py", line 1688, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "C:\Python27\lib\argparse.py", line 1720, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "C:\Python27\lib\argparse.py", line 1926, in _parse_known_args
start_index = consume_optional(start_index)
  File "C:\Python27\lib\argparse.py", line 1866, in consume_optional
take_action(action, args, option_string)
  File "C:\Python27\lib\argparse.py", line 1794, in take_action
action(self, namespace, argument_values, option_string)
  File "C:\Python27\lib\argparse.py", line 994, in __call__
parser.print_help()
  File "C:\Python27\lib\argparse.py", line 2327, in print_help
self._print_message(self.format_help(), file)
  File "C:\Python27\lib\argparse.py", line 2301, in format_help
return formatter.format_help()
  File "C:\Python27\lib\argparse.py", line 279, in format_help
help = self._root_section.format_help()
  File "C:\Python27\lib\argparse.py", line 209, in format_help
func(*args)
  File "C:\Python27\lib\argparse.py", line 317, in _format_usage
action_usage = format(optionals + positionals, groups)
  File "C:\Python27\lib\argparse.py", line 388, in _format_actions_usage
start = actions.index(group._group_actions[0])
IndexError: list index out of range

--
components: Library (Lib)
messages: 264823
nosy: Endre
priority: normal
severity: normal
status: open
title: argparse help formatter crashes
type: crash
versions: Python 2.7

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26952>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com