diff options
-rw-r--r-- | askbot/mail/__init__.py | 6 | ||||
-rw-r--r-- | askbot/mail/parsing.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py index d94c1a5f..066f133a 100644 --- a/askbot/mail/__init__.py +++ b/askbot/mail/__init__.py @@ -1,10 +1,10 @@ """functions that send email in askbot these automatically catch email-related exceptions """ -import logging import os import re import smtplib +import sys from askbot import exceptions from askbot import const from askbot.conf import settings as askbot_settings @@ -135,7 +135,7 @@ def send_mail( if related_object is not None: assert(activity_type is not None) except Exception, error: - logging.critical(unicode(error)) + sys.stderr.write('\n' + error.encode('utf-8') + '\n') if raise_on_failure == True: raise exceptions.EmailNotSent(unicode(error)) @@ -172,7 +172,7 @@ def mail_moderators( msg.content_subtype = 'html' msg.send() except smtplib.SMTPException, error: - logging.critical(unicode(error)) + sys.stderr.write('\n' + error.encode('utf-8') + '\n') if raise_on_failure == True: raise exceptions.EmailNotSent(unicode(error)) diff --git a/askbot/mail/parsing.py b/askbot/mail/parsing.py index f856067c..4472a22e 100644 --- a/askbot/mail/parsing.py +++ b/askbot/mail/parsing.py @@ -56,8 +56,8 @@ def strip_email_client_quote_separator(text): if regex.search(text): return regex.sub('', text) #did not find a quote separator!!! log it - log_message = 'no matching quote separator: %s\n' % text - sys.stdout.write(log_message.encode('utf-8')) + log_message = u'\nno matching quote separator: %s\n' % text + sys.err.write(log_message.encode('utf-8')) return text[:-2]#strip two lines, only guessing here def extract_reply_contents(text, reply_separator=None): |