paul j3 added the comment: I suspect fixing this isn't going to be easy.
Extra lines are removed by the top most `formatter` function: def format_help(self): help = self._root_section.format_help() if help: help = self._long_break_matcher.sub('\n\n', help) help = help.strip('\n') + '\n' return help RawDescriptionHelpFormatter on the other hand just changes one deeply embedded function: def _fill_text(self, text, width, indent): return ''.join(indent + line for line in text.splitlines(keepends=True)) That `format_help` function has no way of distinguishing between '\n' that were part of the raw text, and which were added while assembling the various parts. It could be instructive to try this version of format_help and see just how many \n are being removed: def format_help(self): help = self._root_section.format_help() return help ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17113> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com