[issue4297] Add error_log attribute to optparse.OptionParser

Steven Bethard report at bugs.python.org
Fri Jul 23 14:35:28 CEST 2010

Steven Bethard <steven.bethard at gmail.com> added the comment:

Not sure, but I think _print_message in argparse isn't exactly what the OP is looking for if they really only care about errors. If you want to override how errors are printed, then it's absolutely correct to override the error method (in argparse at least), and your overridden method should be given every message that is normally printed as an error.

If by errors, you mean "anything the parser might print out" (e.g. the output of "--help"), then you may indeed want _print_message to become public so you can override it. Let me know.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list