Author paul.j3
Recipients paul.j3, v+python
Date 2014-06-08.06:03:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In 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 container does not know about
        # check nargs and metavar tuple
            self._get_formatter()._format_args(action, None)
        except ValueError as e:
            raise ArgumentError(action, str(e))
        except TypeError:
            #raise ValueError("length of metavar tuple does not match nargs")
            raise ArgumentError(action, "length of metavar tuple does not match nargs")
        # check the 'help' string
        except (ValueError, TypeError, KeyError) as e:
            raise ArgumentError(action, 'badly formed help string')

The 'except' clause may need to be changed to capture all (or just most?) of the possible errors in the format string.  Besides your error I can imagine '%(error)s` (a KeyError).  We also need to pay attention to the differences between Py2 and Py3 errors.
Date User Action Args
2014-06-08 06:03:05paul.j3setrecipients: + paul.j3, v+python
2014-06-08 06:03:05paul.j3setmessageid: <>
2014-06-08 06:03:05paul.j3linkissue21666 messages
2014-06-08 06:03:04paul.j3create