[issue31330] argparse.RawTextHelpFormatter does not maintain lines separated by more than one newline

paul j3 report at bugs.python.org
Sat Sep 2 11:48:45 EDT 2017


paul j3 added the comment:

I've seen this before, either in another bug/issue or a Stackoverflow question.

The basic change in RawTextHelpFormatter is to turn off the line wrapping for texts like the description.  Multiple newlines are preserved at this step.

But after assembling all the pieces (usage, description, help, epilog) the formatter strips out duplicate newlines.  This is needed because the process of assembly freely inserts newlines between the pieces, regardless of whether they are blank or not.  It can't, or at least doesn't try to, distinguish between newlines within a block like the description, and newlines between blocks.

If someone could come up with a simple patch, great.  Or a simple change to the doc wording.  But I don't think this issue merits a larger fix.

----------

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


More information about the Python-bugs-list mailing list