summaryrefslogtreecommitdiffstats
path: root/pym/portage/elog/mod_save_summary.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/elog/mod_save_summary.py')
-rw-r--r--pym/portage/elog/mod_save_summary.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/elog/mod_save_summary.py b/pym/portage/elog/mod_save_summary.py
index 421fd29ed..f35c71c83 100644
--- a/pym/portage/elog/mod_save_summary.py
+++ b/pym/portage/elog/mod_save_summary.py
@@ -6,6 +6,8 @@
import codecs
import time
from portage import os
+from portage import _encodings
+from portage import _unicode_encode
from portage.data import portage_uid, portage_gid
from portage.localization import _
from portage.util import ensure_dirs, apply_permissions
@@ -19,8 +21,9 @@ def process(mysettings, key, logentries, fulltext):
# TODO: Locking
elogfilename = elogdir+"/summary.log"
- elogfile = codecs.open(elogfilename, mode='a',
- encoding='utf_8', errors='replace')
+ elogfile = codecs.open(_unicode_encode(elogfilename,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='a', encoding=_encodings['content'], errors='backslashreplace')
apply_permissions(elogfilename, mode=060, mask=0)
elogfile.write(_(">>> Messages generated by process %(pid)d on %(time)s for package %(pkg)s:\n\n") %
{"pid": os.getpid(), "time": time.strftime("%Y-%m-%d %H:%M:%S %Z", time.localtime(time.time())), "pkg": key})