diff roundup/cgi/client.py @ 4114:da682f38bad3

bug introduced in the migration to the email package (issue 2550531)
author Richard Jones <richard@users.sourceforge.net>
date Tue, 17 Mar 2009 22:56:38 +0000
parents 3f3f44e3534c
children c15fcee3d8a1
line wrap: on
line diff
--- a/roundup/cgi/client.py	Mon Mar 16 18:04:44 2009 +0000
+++ b/roundup/cgi/client.py	Tue Mar 17 22:56:38 2009 +0000
@@ -14,7 +14,7 @@
 from roundup.exceptions import *
 from roundup.cgi.exceptions import *
 from roundup.cgi.form_parser import FormParser
-from roundup.mailer import Mailer, MessageSendError
+from roundup.mailer import Mailer, MessageSendError, encode_quopri
 from roundup.cgi import accept_language
 from roundup import xmlrpc
 
@@ -991,13 +991,13 @@
                 to = [self.mailer.config.ADMIN_EMAIL]
                 subject = "Templating Error: %s" % exc_info[1]
                 content = cgitb.pt_html()
-                message, writer = self.mailer.get_standard_message(
-                    to, subject)
-                writer.addheader('Content-Transfer-Encoding', 'quoted-printable')
-                body = writer.startbody('text/html; charset=utf-8')
-                content = StringIO(content)
-                quopri.encode(content, body, 0)
-                self.mailer.smtp_send(to, message)
+                message = self.mailer.get_standard_message(to, subject)
+                # delete existing content-type headers
+                del message['Content-type']
+                message['Content-type'] = 'text/html; charset=utf-8'
+                message.set_payload(content)
+                encode_quopri(message)
+                self.mailer.smtp_send(to, str(message))
                 # Now report the error to the user.
                 return self._(error_message)
             except:

Roundup Issue Tracker: http://roundup-tracker.org/