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 BreamoreBoy
Recipients BreamoreBoy, Jason.Baker, bethard, eric.araujo, ned.deily
Date 2013-04-15.00:07:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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\", line 1322, in add_argument
    self._get_formatter()._format_args(action, None)
  File "c:\python33\lib\", 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\", 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 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:44BreamoreBoysetrecipients: + BreamoreBoy, bethard, ned.deily, eric.araujo, Jason.Baker
2013-04-15 00:07:44BreamoreBoysetmessageid: <>
2013-04-15 00:07:44BreamoreBoylinkissue9849 messages
2013-04-15 00:07:44BreamoreBoycreate