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 denversc
Recipients bethard, catherine, denversc
Date 2011-03-19.19:08:58
SpamBayes Score 3.7040717e-08
Marked as misclassified No
Message-id <>
For kicks, I just took a look at this old, forgotten issue.  I agree with the submitter that add_argument() should fail if nargs and metavar do not match, instead of having format_help() raise the exception later on.

I've attached a patch (issue9348_patch_v01.txt) with a proposed fix and associated test cases.  The drawback of my approach is that if a custom HelpFormatter is used which has different semantics for metavar it could cause add_argument() to incorrectly reject the metavar value.  I'm not sure how common that is though.
Date User Action Args
2011-03-19 19:08:59denverscsetrecipients: + denversc, bethard, catherine
2011-03-19 19:08:59denverscsetmessageid: <>
2011-03-19 19:08:58denversclinkissue9348 messages
2011-03-19 19:08:58denversccreate