------------------------------------------------------------
revno: 1344
committer: Mark Sapiro <[email protected]>
branch nick: 2.2
timestamp: Sat 2014-05-17 10:47:42 -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.2
https://code.launchpad.net/~mailman-coders/mailman/2.2
Your team Mailman Checkins is subscribed to branch lp:mailman/2.2.
To unsubscribe from this branch go to
https://code.launchpad.net/~mailman-coders/mailman/2.2/+edit-subscription
=== modified file 'Mailman/Handlers/WrapMessage.py'
--- Mailman/Handlers/WrapMessage.py 2014-04-26 05:35:21 +0000
+++ Mailman/Handlers/WrapMessage.py 2014-05-17 17:47:42 +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:40:56 +0000
+++ Mailman/Message.py 2014-05-17 17:47:42 +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
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org