Commit e8761685 authored by Jérome Perrin's avatar Jérome Perrin

__traceback_info__ can turn the tracebacks into unicode strings, but

MailHost.send (in Zope 2.8) will not be able to parse headers if the mail_text
is passed as a unicode. In such case, convert to string explicitly.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32139 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8c222bd5
...@@ -342,6 +342,12 @@ Exception: %s %s ...@@ -342,6 +342,12 @@ Exception: %s %s
activity_tool.getCurrentNode(), self.user_name, activity_tool.getCurrentNode(), self.user_name,
'/'.join(self.object_path), self.method_id, self.args, self.kw, '/'.join(self.object_path), self.method_id, self.args, self.kw,
call_traceback, self.exc_type, self.exc_value, self.traceback) call_traceback, self.exc_type, self.exc_value, self.traceback)
if isinstance(mail_text, unicode):
# __traceback_info__ can turn the tracebacks into unicode strings, but
# MailHost.send (in Zope 2.8) will not be able to parse headers if the
# mail_text is passed as a unicode.
mail_text = mail_text.encode('utf8')
try: try:
activity_tool.MailHost.send( mail_text ) activity_tool.MailHost.send( mail_text )
except (socket.error, MailHostError), message: except (socket.error, MailHostError), message:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment