diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-21 04:03:15 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-21 04:03:15 +0000 |
commit | 3d11b48d840be203945ff86e46a36fd813008d27 (patch) | |
tree | 2001597adc2ddad19a4983a93ca615369fa52f3c /pym/portage/elog/mod_save_summary.py | |
parent | fbceadf2a286ddc7ac2bf2ae35f491cfc7eb71e8 (diff) | |
download | portage-3d11b48d840be203945ff86e46a36fd813008d27.tar.gz portage-3d11b48d840be203945ff86e46a36fd813008d27.tar.bz2 portage-3d11b48d840be203945ff86e46a36fd813008d27.zip |
Use _encodings where appropriate and add _encodings['stdio'] for stdout
encoding.
svn path=/main/trunk/; revision=14111
Diffstat (limited to 'pym/portage/elog/mod_save_summary.py')
-rw-r--r-- | pym/portage/elog/mod_save_summary.py | 7 |
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}) |