Author paul.j3
Recipients paul.j3, v+python
Date 2014-06-07.16:19:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402157967.17.0.86320602657.issue21666@psf.upfronthosting.co.za>
In-reply-to
Content
First, 'parse_intermixed_args' on stack is not relevant.  It's from an unreleased patch that we worked on.

What matters is the 'print_help', invoked probably with a '-h'.

The error message that normally specifies the problem argument is produced by ArgumentError.  The HelpFormatter does not raise such an error.  ArgumentError is usually used for parsing errors; this is a formatting one.  It's not produced by faulty commandline values.

If you must put strings like '%)` in the help line, use RawTextHelpFormatter.  Otherwise HelpFormatter assumes the help line has valid format expressions like '%(default)s'.

Or you could write your own HelpFormatter subclass with a modified '_expand_help' method, one which wraps the 'self._get_help_string(action) % params' in a 'try' block.  Probably too draconian a measure for a rare problem. :)  

It's an interesting problem, but I don't think it warrants any code changes.
History
Date User Action Args
2014-06-07 16:19:27paul.j3setrecipients: + paul.j3, v+python
2014-06-07 16:19:27paul.j3setmessageid: <1402157967.17.0.86320602657.issue21666@psf.upfronthosting.co.za>
2014-06-07 16:19:27paul.j3linkissue21666 messages
2014-06-07 16:19:26paul.j3create