Issue 2635: fix bug in the fix_sentence_endings option to textwrap.fill.
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index 787153e..c1c09f6 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -129,6 +129,10 @@
expect = ['And she said, "Go to hell!" Can you believe that?']
self.check(wrapper.wrap(text), expect)
+ text = 'File stdio.h is nice.'
+ expect = ['File stdio.h is nice.']
+ self.check(wrapper.wrap(text), expect)
+
def test_wrap_short(self):
# Wrapping to make short lines longer
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 473b98a..ffbb9d1 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -90,6 +90,7 @@
sentence_end_re = re.compile(r'[%s]' # lowercase letter
r'[\.\!\?]' # sentence-ending punct.
r'[\"\']?' # optional end-of-quote
+ r'\Z' # end of chunk
% string.lowercase)