[Python-checkins] python/dist/src/Lib textwrap.py,1.19,1.20
gward@users.sourceforge.net
gward@users.sourceforge.net
Mon, 09 Dec 2002 08:26:08 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv28838
Modified Files:
textwrap.py
Log Message:
Fix SF bug #622849: in _wrap_chunks(), ensure that leading whitespace in
the input string is always preserved.
Index: textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** textwrap.py 9 Dec 2002 16:23:08 -0000 1.19
--- textwrap.py 9 Dec 2002 16:26:05 -0000 1.20
***************
*** 203,208 ****
width = self.width - len(indent)
! # First chunk on line is whitespace -- drop it.
! if chunks[0].strip() == '':
del chunks[0]
--- 203,209 ----
width = self.width - len(indent)
! # First chunk on line is whitespace -- drop it, unless this
! # is the very beginning of the text (ie. no lines started yet).
! if chunks[0].strip() == '' and lines:
del chunks[0]