------------------------------------------------------------ revno: 1694 fixes bug: https://launchpad.net/bugs/1670033 committer: Mark Sapiro <m...@msapiro.net> branch nick: 2.1 timestamp: Sat 2017-03-04 13:21:54 -0800 message: Ensure added headers and footers have a trailing new-line. modified: Mailman/Handlers/Decorate.py NEWS tests/test_handlers.py
-- lp:mailman/2.1 https://code.launchpad.net/~mailman-coders/mailman/2.1 Your team Mailman Checkins is subscribed to branch lp:mailman/2.1. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Handlers/Decorate.py' --- Mailman/Handlers/Decorate.py 2010-06-05 17:27:39 +0000 +++ Mailman/Handlers/Decorate.py 2017-03-04 21:21:54 +0000 @@ -240,4 +240,7 @@ except (ValueError, TypeError), e: syslog('error', 'Exception while calculating %s:\n%s', what, e) text = template + # Ensure text ends with new-line + if not text.endswith('\n'): + text += '\n' return text === modified file 'NEWS' --- NEWS 2017-02-23 06:05:56 +0000 +++ NEWS 2017-03-04 21:21:54 +0000 @@ -26,6 +26,9 @@ Bug fixes and other patches + - Ensured that added message and digest headers and footers always have + a terminating new-line. (LP: #1670033) + - Fixed an uncaught TypeError in the subscribe CGI. (LP: #1667215) - Added recognition for a newly seen mailEnable bounce. === modified file 'tests/test_handlers.py' --- tests/test_handlers.py 2016-03-02 09:57:16 +0000 +++ tests/test_handlers.py 2017-03-04 21:21:54 +0000 @@ -886,7 +886,8 @@ self.assertEqual(msg.get_payload(), """\ header Here is a message. -footer""") +footer +""") def test_no_multipart_template(self): mlist = self._mlist @@ -902,7 +903,8 @@ self.assertEqual(msg.get_payload(), """\ XTest header Here is a message. -XTest footer""") +XTest footer +""") def test_no_multipart_type_error(self): mlist = self._mlist @@ -918,7 +920,8 @@ self.assertEqual(msg.get_payload(), """\ %(real_name) header Here is a message. -%(real_name) footer""") +%(real_name) footer +""") def test_no_multipart_value_error(self): mlist = self._mlist @@ -935,7 +938,8 @@ self.assertEqual(msg.get_payload(), """\ %(real_name)p header Here is a message. -%(real_name)p footer""") +%(real_name)p footer +""") def test_no_multipart_missing_key(self): mlist = self._mlist @@ -950,7 +954,8 @@ self.assertEqual(msg.get_payload(), """\ %(spooge)s header Here is a message. -%(spooge)s footer""") +%(spooge)s footer +""") def test_multipart(self): eq = self.ndiffAssertEqual @@ -984,6 +989,7 @@ Content-Disposition: inline header + --BOUNDARY From: aper...@dom.ain @@ -1001,6 +1007,7 @@ Content-Disposition: inline footer + --BOUNDARY-- """)
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org