New submission from Larry Hastings <la...@hastings.org>: If you word-wrap a paragraph twice with textwrap, you may get different results. Specifically, you *will* get different results when: * the original text has a line that is too long by one character, * the last word on the line is the first word in a new sentence, and * there are two spaces after the period.
The first textwrap will replace the two spaces after the period with a newline; the second textwrap will replace the newline with a single space. Attached is a test case demonstrating the problem. It's not a big problem, but it did cause an assertion failure in blurb. The workaround was to word-wrap all paragraphs twice, which works but is kind of dumb. ---------- components: Library (Lib) files: textwrap.isnt.stable.py messages: 308872 nosy: larry priority: low severity: normal status: open title: textwrap output may change if you wrap a paragraph twice versions: Python 3.7 Added file: https://bugs.python.org/file47344/textwrap.isnt.stable.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32397> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com