[issue9938] Documentation for argparse interactive use

Xuanji Li report at bugs.python.org
Wed Apr 27 12:24:27 CEST 2011


Xuanji Li <xuanji at gmail.com> added the comment:

I don't think it's best to create a new subclass to throw an ArgumentParserExit exception; if I read the stack trace I'd see that an ArgumentError was thrown, then caught, then an ArgumentParserExit was thrown, which IMHO is confusing. In the current design, parse_known_errors catches an ArgumentError and then exits. I propose that the user be optionally allowed to turn off the handling of ArgumentError and to handle it himself instead through an exit_on_argument_error flag. 

Attached patch does this. Also I think this issue falls under component 'Lib' too.

----------
components: +Library (Lib)
keywords: +patch
Added file: http://bugs.python.org/file21793/issue9938.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9938>
_______________________________________


More information about the Python-bugs-list mailing list