gh-139065: Fix trailing space before long word in textwrap (GH-139070)

Fix trailing space before a wrapped long word if the line length with
a space is exactly "width".
This commit is contained in:
Serhiy Storchaka 2025-10-10 16:29:18 +03:00 committed by GitHub
parent 5c942f11cd
commit 1c598e0436
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -605,7 +605,7 @@ def test_break_long(self):
# bug 1146. Prevent a long word to be wrongly wrapped when the
# preceding word is exactly one character shorter than the width
self.check_wrap(self.text, 12,
['Did you say ',
['Did you say',
'"supercalifr',
'agilisticexp',
'ialidocious?',
@ -633,7 +633,7 @@ def test_nobreak_long(self):
def test_max_lines_long(self):
self.check_wrap(self.text, 12,
['Did you say ',
['Did you say',
'"supercalifr',
'agilisticexp',
'[...]'],