[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-09 Thread Jake Hunsaker
Jake Hunsaker added the comment: Ok, yeah there seem to be several paths to avoid this behavior then. We should be fine exploring those options. Thanks for the pointer! -- ___ Python tracker <https://bugs.python.org/issue42

[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-09 Thread Jake Hunsaker
Jake Hunsaker added the comment: Ah, ok - so I neglected to mention we're using subparsers which appears to be relevant here. My apologies. Here's a minimal reproducer that shows the behavior when using './arg_test.py foo --bar=on' ``` #! /bin/python3 import argparse usage_string = 'test

[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-09 Thread Jake Hunsaker
Jake Hunsaker added the comment: I'll try and get a simple reproducer made shortly, however as a quick note I've found that using '--all-logs on' results in a properly formatted error message. -- ___ Python tracker <https://bugs.python.

[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-09 Thread Jake Hunsaker
New submission from Jake Hunsaker : In the sos project, we build a custom `usage` string for our argparser parser, and have noticed that doing so causes error messages from argparse to be badly formatted. For example if a bad option value is given, the error message is mangled into the last