[issue2635] textwrap: bug in 'fix_sentence_endings' option

Giuseppe Scelsi report at bugs.python.org
Tue Apr 15 07:54:45 CEST 2008


New submission from Giuseppe Scelsi <giuseppe.scelsi at analog.com>:

>>> textwrap.fill('File stdio.h is nice.',
...     fix_sentence_endings=True)
'File stdio.h  is nice.'
              ^-- wrong double space!

The problem is with the compiled regexp 'sentence_end_re' in
'textwrap.py'.  A possible fix would be to add the following line after
line 90 in textwrap.py:

    r'$'  # end of chunk

Giuseppe

----------
components: Library (Lib)
messages: 65501
nosy: gscelsi
severity: normal
status: open
title: textwrap: bug in 'fix_sentence_endings' option
type: behavior
versions: Python 2.4

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2635>
__________________________________


More information about the Python-bugs-list mailing list