Mark Lawrence added the comment:
The behaviour has changed from that given in msg116355. Using Python 3.3.1 on
Windows.
>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', nargs='1')
Traceback (most recent call last):
File "c:\python33\lib\argparse.py", line 1322, in add_argument
self._get_formatter()._format_args(action, None)
File "c:\python33\lib\argparse.py", line 585, in _format_args
formats = ['%s' for _ in range(action.nargs)]
TypeError: 'str' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\python33\lib\argparse.py", line 1324, in add_argument
raise ValueError("length of metavar tuple does not match nargs")
ValueError: length of metavar tuple does not match nargs
The docs http://docs.python.org/3/library/argparse.html#nargs are clear that
nargs is an integer or various types of string so I think this could be closed
as already fixed.
----------
nosy: +BreamoreBoy
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9849>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com