paul j3 added the comment: 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. ---------- nosy: +paul.j3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21666> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com