diff options
author | Raymond Hettinger <python@rcn.com> | 2003-08-30 14:43:55 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-08-30 14:43:55 +0000 |
commit | c11dbcd4bfb6c366e9ce541b982a036b34f7c30c (patch) | |
tree | 1ff7b900d7de13d81b1c46b0ba8c3c882184d679 /Lib/test/test_textwrap.py | |
parent | 62297132215490e9cb406e1a21f03aff40d421cb (diff) | |
download | cpython-git-c11dbcd4bfb6c366e9ce541b982a036b34f7c30c.tar.gz |
SF bug 797650: Infinite loop in textwrap.py
When the indents were set to longer than the width and long word breaking
was enabled, an infinite loop would result because the inner loop did not
assure that at least one character was stripped off on every pass.
Diffstat (limited to 'Lib/test/test_textwrap.py')
-rw-r--r-- | Lib/test/test_textwrap.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py index 904c79091d..a0111680b4 100644 --- a/Lib/test/test_textwrap.py +++ b/Lib/test/test_textwrap.py @@ -305,6 +305,16 @@ How *do* you spell that odd word, anyways? ['Did you say "supercalifragilisticexpialidocious?"', 'How *do* you spell that odd word, anyways?']) + # SF bug 797650. Prevent an infinite loop by making sure that at + # least one character gets split off on every pass. + self.check_wrap('-'*10+'hello', 10, + ['----------', + ' h', + ' e', + ' l', + ' l', + ' o'], + subsequent_indent = ' '*15) def test_nobreak_long(self): # Test with break_long_words disabled |