summaryrefslogtreecommitdiffstats
path: root/pym/portage/elog/mod_mail_summary.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/elog/mod_mail_summary.py')
-rw-r--r--pym/portage/elog/mod_mail_summary.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage/elog/mod_mail_summary.py b/pym/portage/elog/mod_mail_summary.py
index adffd4640..e642dc044 100644
--- a/pym/portage/elog/mod_mail_summary.py
+++ b/pym/portage/elog/mod_mail_summary.py
@@ -8,6 +8,8 @@ from portage.exception import PortageException
from portage.localization import _
from portage.util import writemsg
from portage import os
+from portage import _encodings
+from portage import _unicode_decode
import socket
import time
@@ -15,8 +17,11 @@ import time
_items = {}
def process(mysettings, key, logentries, fulltext):
global _items
+ time_str = _unicode_decode(
+ time.strftime("%Y%m%d-%H%M%S %Z", time.localtime(time.time())),
+ encoding=_encodings['content'], errors='replace')
header = _(">>> Messages generated for package %(pkg)s by process %(pid)d on %(time)s:\n\n") % \
- {"pkg": key, "pid": os.getpid(), "time": time.strftime("%Y%m%d-%H%M%S %Z", time.localtime(time.time()))}
+ {"pkg": key, "pid": os.getpid(), "time": time_str}
config_root = mysettings["PORTAGE_CONFIGROOT"]
mysettings, items = _items.setdefault(config_root, (mysettings, {}))
items[key] = header + fulltext