This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: textwrap: bug in 'fix_sentence_endings' option
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.4, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gscelsi, mark.dickinson
Priority: normal Keywords: easy

Created on 2008-04-15 05:54 by gscelsi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg65501 - (view) Author: Giuseppe Scelsi (gscelsi) Date: 2008-04-15 05:54
>>> 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
msg65645 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-04-20 13:15
I can reproduce the problem, and agree with the analysis.

Giuseppe, do you have time to produce a patch that fixes
this problem and adds appropriate tests to test_textwrap.py?
msg65655 - (view) Author: Giuseppe Scelsi (gscelsi) Date: 2008-04-20 23:53
Mark,

I am not familiar with the process and at this particular time I am
quite busy.  I am happy to do it if it not urgent, but that might mean
after I come back from overseas in June.  Otherwise please go ahead with
the changes, for someone familiar with the process it should be a very
simple matter.  PLease let me know.

Thanks and regards,

Giuseppe

----

> Mark Dickinson <dickinsm@gmail.com> added the comment:
>
> I can reproduce the problem, and agree with the analysis.
>
> Giuseppe, do you have time to produce a patch that fixes
> this problem and adds appropriate tests to test_textwrap.py?
>
> ----------
> keywords: +easy
> nosy: +marketdickinson
> priority:  -> normal
> versions: +Python 2.5, Python 2.6
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue2635>
> __________________________________
msg65794 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-04-25 16:59
Fixed for Python 2.6 in r62500.  Thanks for the report!
History
Date User Action Args
2022-04-11 14:56:33adminsetgithub: 46887
2008-04-25 17:00:02mark.dickinsonsetstatus: open -> closed
resolution: fixed
2008-04-25 16:59:46mark.dickinsonsetmessages: + msg65794
2008-04-20 23:53:04gscelsisetmessages: + msg65655
2008-04-20 13:15:17mark.dickinsonsetpriority: normal
keywords: + easy
messages: + msg65645
nosy: + mark.dickinson
versions: + Python 2.6, Python 2.5
2008-04-15 05:54:45gscelsicreate