------------------------------------------------------------ revno: 1487 fixes bug: https://launchpad.net/bugs/1316682 committer: Mark Sapiro <m...@msapiro.net> branch nick: 2.1 timestamp: Sat 2014-05-17 10:45:30 -0700 message: Changed the fix for LP: #1316682 to not create a message that triggers Python issue 7970 rather than incorporating the fix for issue 7970 in our Generator subclass. modified: Mailman/Handlers/WrapMessage.py Mailman/Message.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/WrapMessage.py' --- Mailman/Handlers/WrapMessage.py 2014-04-26 05:15:07 +0000 +++ Mailman/Handlers/WrapMessage.py 2014-05-17 17:45:30 +0000 @@ -67,6 +67,6 @@ # Add the headers from CookHeaders. for k, v in msgdata['add_header'].items(): msg[k] = v - # And set the payload. - msg.set_payload(omsg.as_string()) + # And set the payload the way email parses it. + msg.set_payload([omsg]) === modified file 'Mailman/Message.py' --- Mailman/Message.py 2014-05-06 16:35:47 +0000 +++ Mailman/Message.py 2014-05-17 17:45:30 +0000 @@ -59,25 +59,6 @@ return self.__class__(fp, self._mangle_from_, self.__children_maxheaderlen, self.__children_maxheaderlen) - # This is the _handle_message method with the fix for bug 7970. - def _handle_message(self, msg): - s = StringIO() - g = self.clone(s) - # The payload of a message/rfc822 part should be a multipart sequence - # of length 1. The zeroth element of the list should be the Message - # object for the subpart. Extract that object, stringify it, and - # write it out. - # Except, it turns out, when it's a string instead, which happens when - # and only when HeaderParser is used on a message of mime type - # message/rfc822. Such messages are generated by, for example, - # Groupwise when forwarding unadorned messages. (Issue 7970.) So - # in that case we just emit the string body. - payload = msg.get_payload() - if isinstance(payload, list): - g.flatten(msg.get_payload(0), unixfrom=False) - payload = s.getvalue() - self._fp.write(payload) - class Message(email.Message.Message):
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org