summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-30 06:52:39 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-30 06:52:39 +0000
commit8cb658ccf7776d622b7f63c72337b0897ad0d1be (patch)
tree4dfa3c21abb549742133824f37e847dfa72f9510 /pym
parentBug #261377 - Add a new 'egencache' tool to generate metadata cache for (diff)
downloadportage-multirepo-8cb658ccf7776d622b7f63c72337b0897ad0d1be.tar.gz
portage-multirepo-8cb658ccf7776d622b7f63c72337b0897ad0d1be.tar.bz2
portage-multirepo-8cb658ccf7776d622b7f63c72337b0897ad0d1be.zip
Bug #263370 - In create_message(), use email.header.Header to wrap the
subject, as a workaround so that long subject lines are wrapped correctly by <=python-2.6 (gentoo bug #263370, python issue #1974). (trunk r13261) svn path=/main/branches/2.1.6/; revision=13440
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/mail.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/mail.py b/pym/portage/mail.py
index 72b41126..5f1cc11a 100644
--- a/pym/portage/mail.py
+++ b/pym/portage/mail.py
@@ -7,6 +7,7 @@ import portage.exception, socket, smtplib, os, sys, time
from email.MIMEText import MIMEText as TextMessage
from email.MIMEMultipart import MIMEMultipart as MultipartMessage
from email.MIMEBase import MIMEBase as BaseMessage
+from email.header import Header
def create_message(sender, recipient, subject, body, attachments=None):
if attachments == None:
@@ -25,7 +26,9 @@ def create_message(sender, recipient, subject, body, attachments=None):
mymessage.set_unixfrom(sender)
mymessage["To"] = recipient
mymessage["From"] = sender
- mymessage["Subject"] = subject
+ # Use Header as a workaround so that long subject lines are wrapped
+ # correctly by <=python-2.6 (gentoo bug #263370, python issue #1974).
+ mymessage["Subject"] = Header(subject)
mymessage["Date"] = time.strftime("%a, %d %b %Y %H:%M:%S %z")
return mymessage