Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 4113:f4641359b892 | 4114:da682f38bad3 |
|---|---|
| 12 from roundup.cgi import templating, cgitb, TranslationService | 12 from roundup.cgi import templating, cgitb, TranslationService |
| 13 from roundup.cgi.actions import * | 13 from roundup.cgi.actions import * |
| 14 from roundup.exceptions import * | 14 from roundup.exceptions import * |
| 15 from roundup.cgi.exceptions import * | 15 from roundup.cgi.exceptions import * |
| 16 from roundup.cgi.form_parser import FormParser | 16 from roundup.cgi.form_parser import FormParser |
| 17 from roundup.mailer import Mailer, MessageSendError | 17 from roundup.mailer import Mailer, MessageSendError, encode_quopri |
| 18 from roundup.cgi import accept_language | 18 from roundup.cgi import accept_language |
| 19 from roundup import xmlrpc | 19 from roundup import xmlrpc |
| 20 | 20 |
| 21 def initialiseSecurity(security): | 21 def initialiseSecurity(security): |
| 22 '''Create some Permissions and Roles on the security object | 22 '''Create some Permissions and Roles on the security object |
| 989 # If possible, send the HTML page template traceback | 989 # If possible, send the HTML page template traceback |
| 990 # to the administrator. | 990 # to the administrator. |
| 991 to = [self.mailer.config.ADMIN_EMAIL] | 991 to = [self.mailer.config.ADMIN_EMAIL] |
| 992 subject = "Templating Error: %s" % exc_info[1] | 992 subject = "Templating Error: %s" % exc_info[1] |
| 993 content = cgitb.pt_html() | 993 content = cgitb.pt_html() |
| 994 message, writer = self.mailer.get_standard_message( | 994 message = self.mailer.get_standard_message(to, subject) |
| 995 to, subject) | 995 # delete existing content-type headers |
| 996 writer.addheader('Content-Transfer-Encoding', 'quoted-printable') | 996 del message['Content-type'] |
| 997 body = writer.startbody('text/html; charset=utf-8') | 997 message['Content-type'] = 'text/html; charset=utf-8' |
| 998 content = StringIO(content) | 998 message.set_payload(content) |
| 999 quopri.encode(content, body, 0) | 999 encode_quopri(message) |
| 1000 self.mailer.smtp_send(to, message) | 1000 self.mailer.smtp_send(to, str(message)) |
| 1001 # Now report the error to the user. | 1001 # Now report the error to the user. |
| 1002 return self._(error_message) | 1002 return self._(error_message) |
| 1003 except: | 1003 except: |
| 1004 # Reraise the original exception. The user will | 1004 # Reraise the original exception. The user will |
| 1005 # receive an error message, and the adminstrator will | 1005 # receive an error message, and the adminstrator will |
