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

2021-12-16 Thread Lucas Cimon
Lucas Cimon added the comment: This was resolved by https://github.com/python/cpython/pull/28050 -- message_count: 4.0 -> 5.0 pull_requests: +28366 status: open -> closed pull_request: https://github.com/python/cpython/pull/28050 ___ Python tracker

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

2019-10-24 Thread paul j3
paul j3 added the comment: Just today on SO someone found a similar bug in the help format with metavars, that involved an unpacking the expected only one value, but got 2. https://stackoverflow.com/questions/58541460/tuple-metavar-value-for-positional-argument-with-nargs-1 This had be raise

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

2019-10-24 Thread Lucas Cimon
Lucas Cimon 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.

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

2019-10-24 Thread paul j3
paul j3 added the comment: So the error occurs in HelpFormatter._format_action when 'help_lines' is an empty list: if action.help: help_text = self._expand_help(action) help_lines = self._split_lines(help_text, help_width) >> parts.append(

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

2019-10-24 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

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

2019-10-24 Thread Lucas Cimon
Change by Lucas Cimon : -- keywords: +patch pull_requests: +16448 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16917 ___ Python tracker ___

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

2019-10-24 Thread Lucas Cimon
New submission from Lucas Cimon : The test I am going to add to test_argparse.py: def test_whitespace_help(self): parser = self._get_parser() parser.add_argument( '--foo2', action='store_true', help=' ') parser.add_argument( 'bar2', type=float