[Python-bugs-list] [ python-Bugs-622849 ] inconsistent results of leading whitespace in textwrap input

noreply@sourceforge.net noreply@sourceforge.net
Sun, 13 Oct 2002 22:00:46 -0700


Bugs item #622849, was opened at 2002-10-13 21:00
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=622849&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: R. David Murray (rdmurray)
Assigned to: Nobody/Anonymous (nobody)
Summary: inconsistent results of leading whitespace in textwrap input

Initial Comment:
>>> x = TextWrapper()       
>>> x.wrap('This is a sentence that will not wrap')
['This is a sentence that will not wrap']
>>> x.wrap('  This is a sentence that will not wrap')
['  This is a sentence that will not wrap']
>>> x.wrap('This is a sentence that will wrap because I have added a bunch of words to it until it is longer than 70 chars.')
['This is a sentence that will wrap because I have added a bunch of', 'words to it until it is longer than 70 chars.']
>>> x.wrap('  This is a sentence that will wrap because I have added a bunch of words to it until it is longer than 70 chars.')
['This is a sentence that will wrap because I have added a bunch of', 'words to it until it is longer than 70 chars.']

To me, this looks like a bug.  It violates POLA, anyway (took me a while
to figure out why one paragraph and only one paragraph in my output
was indented more than the rest).


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=622849&group_id=5470