Message186962
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. |
|
Date |
User |
Action |
Args |
2013-04-15 00:07:44 | BreamoreBoy | set | recipients:
+ BreamoreBoy, bethard, ned.deily, eric.araujo, Jason.Baker |
2013-04-15 00:07:44 | BreamoreBoy | set | messageid: <1365984464.63.0.985045868365.issue9849@psf.upfronthosting.co.za> |
2013-04-15 00:07:44 | BreamoreBoy | link | issue9849 messages |
2013-04-15 00:07:44 | BreamoreBoy | create | |
|