changeset: 104713:049e58f74272 parent: 104710:b86dacb9e668 parent: 104712:ebe5bd33f86f user: Serhiy Storchaka date: Tue Oct 25 15:03:59 2016 +0300 files: Misc/NEWS description: 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. diff -r b86dacb9e668 -r 049e58f74272 Lib/calendar.py --- a/Lib/calendar.py Tue Oct 25 14:47:53 2016 +0300 +++ b/Lib/calendar.py Tue Oct 25 15:03:59 2016 +0300 @@ -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 -r b86dacb9e668 -r 049e58f74272 Lib/test/test_calendar.py --- a/Lib/test/test_calendar.py Tue Oct 25 14:47:53 2016 +0300 +++ b/Lib/test/test_calendar.py Tue Oct 25 15:03:59 2016 +0300 @@ -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 -r b86dacb9e668 -r 049e58f74272 Misc/NEWS --- a/Misc/NEWS Tue Oct 25 14:47:53 2016 +0300 +++ b/Misc/NEWS Tue Oct 25 15:03:59 2016 +0300 @@ -97,6 +97,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.