changeset 2197:bea488a1beef

unicode literals for email subject
author Ana Balica <ana.balica@gmail.com>
date Sun, 22 Sep 2013 10:27:36 +0200
parents 337b8bb2c903
children 2bc9a1b3bdbd
files MoinMoin/log.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/log.py	Sun Sep 15 14:03:59 2013 +0200
+++ b/MoinMoin/log.py	Sun Sep 22 10:27:36 2013 +0200
@@ -1,7 +1,6 @@
 # Copyright: 2008 MoinMoin:ThomasWaldmann
 # Copyright: 2007 MoinMoin:JohannesBerg
 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
-
 """
     MoinMoin - init "logging" system
 
@@ -182,11 +181,11 @@
     """ A custom handler class which sends email for each logging event using
     wiki mail configuration
     """
-    def __init__(self, toaddrs=[], subject=''):
+    def __init__(self, toaddrs=[], subject=u''):
         """ Initialize the handler
 
         @param toaddrs: address or a list of email addresses whom to send email
-        @param subject: email's subject
+        @param subject: unicode email's subject
         """
         logging.Handler.__init__(self)
         if isinstance(toaddrs, basestring):
@@ -206,7 +205,7 @@
         # arguments and make the decision to send mail or not here
         toaddrs = self.toaddrs if self.toaddrs else cfg.admin_emails
         log_level = logging.getLevelName(self.level)
-        subject = self.subject if self.subject else '[{0}][{1}] Log message'.format(
+        subject = self.subject if self.subject else u'[{0}][{1}] Log message'.format(
             cfg.sitename, log_level)
         msg = self.format(record)
         if app.cfg.email_tracebacks: