[issue21666] Argparse exceptions should include which argument has a problem

2014-06-07 Thread paul j3
paul j3 added the comment: In http://bugs.python.org/file30010/nargswarn.patch adding the '_expand_help(action)' line should test the help string (during add_argument). def _check_argument(self, action): # check action arguments # focus on the arguments that the parent conta

[issue21666] Argparse exceptions should include which argument has a problem

2014-06-07 Thread paul j3
paul j3 added the comment: The ''_expand_help' method formats one action (argument) at a time, so it could issue an error message that includes that action's name. The disconnect that you noticed arises because your bad 'help' parameter wasn't tested until is was used in a 'print_help'. http:

[issue21666] Argparse exceptions should include which argument has a problem

2014-06-07 Thread Glenn Linderman
Glenn Linderman added the comment: Yes, I hope someday the parse_intermixed_args patch can be released... but I know it is not relevant to this issue. I was aware of the %(substitution_variables) in the default help formatter, but I (1) goofed and entered % without escaping it (2) was surprise

[issue21666] Argparse exceptions should include which argument has a problem

2014-06-07 Thread paul j3
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. T

[issue21666] Argparse exceptions should include which argument has a problem

2014-06-04 Thread Glenn Linderman
Changes by Glenn Linderman : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue21666] Argparse exceptions should include which argument has a problem

2014-06-04 Thread Glenn Linderman
New submission from Glenn Linderman: I coded up a new program, with a bunch of options, and got the following traceback when I tried to run it: Traceback (most recent call last): File "D:\my\py\renmany.py", line 273, in args = cmdl.parse_intermixed_args() File "D:\my\py\glu\glu.py", li