[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
serhiy.storchaka
python-checkins at python.org
Tue Oct 25 08:04:28 EDT 2016
https://hg.python.org/cpython/rev/ebe5bd33f86f
changeset: 104712:ebe5bd33f86f
branch: 3.6
parent: 104709:bfa400108fc5
parent: 104711:8d54c2a1c796
user: Serhiy Storchaka <storchaka at gmail.com>
date: Tue Oct 25 15:02:36 2016 +0300
summary:
Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
at the start of new line after printing a month's calendar. Patch by
Xiang Zhang.
files:
Lib/calendar.py | 2 +-
Lib/test/test_calendar.py | 3 +--
Misc/NEWS | 4 ++++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Lib/calendar.py b/Lib/calendar.py
--- a/Lib/calendar.py
+++ b/Lib/calendar.py
@@ -314,7 +314,7 @@
"""
Print a month's calendar.
"""
- print(self.formatmonth(theyear, themonth, w, l), end=' ')
+ print(self.formatmonth(theyear, themonth, w, l), end='')
def formatmonth(self, theyear, themonth, w=0, l=0):
"""
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -409,8 +409,7 @@
def test_prmonth(self):
with support.captured_stdout() as out:
calendar.TextCalendar().prmonth(2004, 1)
- output = out.getvalue().strip()
- self.assertEqual(output, result_2004_01_text.strip())
+ self.assertEqual(out.getvalue(), result_2004_01_text)
def test_pryear(self):
with support.captured_stdout() as out:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,10 @@
Library
-------
+- Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
+ at the start of new line after printing a month's calendar. Patch by
+ Xiang Zhang.
+
- Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces.
Based on patch by Kaarle Ritvanen.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list