# Distributed under the terms of the GNU General Public License v2
# $Id$
+import codecs
import os, time
from portage.data import portage_uid, portage_gid
from portage.util import ensure_dirs
ensure_dirs(elogdir, uid=portage_uid, gid=portage_gid, mode=02770)
elogfilename = elogdir+"/"+path+":"+time.strftime("%Y%m%d-%H%M%S", time.gmtime(time.time()))+".log"
- elogfile = open(elogfilename, "w")
+ elogfile = codecs.open(elogfilename, mode='w',
+ encoding='utf_8', errors='replace')
elogfile.write(fulltext)
elogfile.close()
# Distributed under the terms of the GNU General Public License v2
# $Id$
+import codecs
import os, time
from portage.data import portage_uid, portage_gid
from portage.localization import _
# TODO: Locking
elogfilename = elogdir+"/summary.log"
- elogfile = open(elogfilename, "a")
+ elogfile = codecs.open(elogfilename, mode='a',
+ encoding='utf_8', errors='replace')
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})