[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

Lucas Cimon report at bugs.python.org
Thu Oct 24 18:22:57 EDT 2019


Lucas Cimon <lucas.cimon at gmail.com> added the comment:

Thanks for the feedbacks paul.j3 !

I totally agree it would be best to test all formatter classes.
I modified the new test to do so.

I think I should probably place this test somewhere else in test_argparse.py, but I'm having trouble figuring out where exactly... I just updated the PR and moved the new test to the TestOptionalsHelpVersionActions class.

About the best fix, I think a fix to _split_lines() would be more complex. It needs to return a list, so we would make it return [''] in that case ? That would be a bit strange.

What do you think ? :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38584>
_______________________________________


More information about the Python-bugs-list mailing list