This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rrt
Recipients rrt
Date 2021-04-26.09:29:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619429345.55.0.132994171177.issue43942@roundup.psfhosted.org>
In-reply-to
Content
The documentation seems very clear on this subject:

"RawTextHelpFormatter maintains whitespace for all sorts of help text, including argument descriptions. However, multiple new lines are replaced with one."

But consider the following code:

```
from argparse import ArgumentParser, RawDescriptionHelpFormatter

parser = ArgumentParser(
  description='A simple templating system.',
  epilog='Use `-\' as a file name to indicate standard input or output.',
  formatter_class=RawDescriptionHelpFormatter,
)
parser.add_argument(
  '--verbose',
  help='show on standard error the path being built,\nand the names of files built, included and pasted'
)
args = parser.parse_args()
```

Then try running it in a suitably-sized terminal:

$ python3 test.py --help
usage: test.py [-h] [--verbose VERBOSE]

A simple templating system.

optional arguments:
  -h, --help         show this help message and exit
  --verbose VERBOSE  show on standard error the path being built, and the names of files built, included and pasted

Use `-' as a file name to indicate standard input or output.
```

The \n in the help for the `--verbose` argument is not respected.
History
Date User Action Args
2021-04-26 09:29:05rrtsetrecipients: + rrt
2021-04-26 09:29:05rrtsetmessageid: <1619429345.55.0.132994171177.issue43942@roundup.psfhosted.org>
2021-04-26 09:29:05rrtlinkissue43942 messages
2021-04-26 09:29:05rrtcreate