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 <1300561739.36.0.858826272155.issue9348@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-03-19 19:08:59denverscsetrecipients: + denversc, bethard, catherine
2011-03-19 19:08:59denverscsetmessageid: <1300561739.36.0.858826272155.issue9348@psf.upfronthosting.co.za>
2011-03-19 19:08:58denversclinkissue9348 messages
2011-03-19 19:08:58denversccreate