diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-19 07:22:05 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-19 07:22:05 +0000 |
commit | 2c1facb4462ccbaeb550547592385c56b6c87b20 (patch) | |
tree | c16fee9a24929a12cc1a752f6a64772606a152be | |
parent | 1491b861415ded10623101e54c5e0853853455b0 (diff) | |
download | portage-2c1facb4462ccbaeb550547592385c56b6c87b20.tar.gz portage-2c1facb4462ccbaeb550547592385c56b6c87b20.tar.bz2 portage-2c1facb4462ccbaeb550547592385c56b6c87b20.zip |
Use _encodings where appropriate.
svn path=/main/trunk/; revision=14101
-rw-r--r-- | pym/_emerge/EbuildPhase.py | 12 | ||||
-rw-r--r-- | pym/_emerge/PackageUninstall.py | 7 |
2 files changed, 13 insertions, 6 deletions
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py index 9d2ec632d..51f018cb1 100644 --- a/pym/_emerge/EbuildPhase.py +++ b/pym/_emerge/EbuildPhase.py @@ -8,6 +8,8 @@ from _emerge.CompositeTask import CompositeTask from portage.util import writemsg import portage from portage import os +from portage import _encodings +from portage import _unicode_encode import codecs class EbuildPhase(CompositeTask): @@ -32,8 +34,9 @@ class EbuildPhase(CompositeTask): log_path = self.settings.get("PORTAGE_LOG_FILE") log_file = None if self.background and log_path is not None: - log_file = codecs.open(log_path, mode='a', - encoding='utf_8', errors='replace') + log_file = codecs.open(_unicode_encode(log_path, + encoding=_encodings['fs'], errors='strict'), + mode='a', encoding=_encodings['content'], errors='replace') out = log_file try: portage._check_build_log(self.settings, out=out) @@ -52,8 +55,9 @@ class EbuildPhase(CompositeTask): log_path = self.settings.get("PORTAGE_LOG_FILE") log_file = None if self.background and log_path is not None: - log_file = codecs.open(log_path, mode='a', - encoding='utf_8', errors='replace') + log_file = codecs.open(_unicode_encode(log_path, + encoding=_encodings['fs'], errors='strict'), + mode='a', encoding=_encodings['content'], errors='replace') out = log_file portage._post_src_install_chost_fix(settings) portage._post_src_install_uid_fix(settings, out=out) diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py index d86947c4a..fdd59e149 100644 --- a/pym/_emerge/PackageUninstall.py +++ b/pym/_emerge/PackageUninstall.py @@ -6,6 +6,8 @@ import codecs import logging import portage from portage import os +from portage import _encodings +from portage import _unicode_encode from _emerge.AsynchronousTask import AsynchronousTask from _emerge.unmerge import unmerge from _emerge.UninstallFailure import UninstallFailure @@ -45,8 +47,9 @@ class PackageUninstall(AsynchronousTask): portage.util.writemsg_level(msg, level=level, noiselevel=noiselevel) - f = codecs.open(log_path, mode='a', - encoding='utf_8', errors='replace') + f = codecs.open(_unicode_encode(log_path, + encoding=_encodings['fs'], errors='strict'), + mode='a', encoding=_encodings['content'], errors='replace') try: f.write(msg) finally: |