summaryrefslogtreecommitdiffstats
path: root/pym/portage/output.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-21 04:03:15 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-21 04:03:15 +0000
commit3d11b48d840be203945ff86e46a36fd813008d27 (patch)
tree2001597adc2ddad19a4983a93ca615369fa52f3c /pym/portage/output.py
parentfbceadf2a286ddc7ac2bf2ae35f491cfc7eb71e8 (diff)
downloadportage-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/output.py')
-rw-r--r--pym/portage/output.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 6ebbc0bdf..0e016c5c6 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -17,8 +17,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
)
from portage import os
-from portage import _content_encoding
-from portage import _fs_encoding
+from portage import _encodings
from portage import _unicode_encode
from portage.const import COLOR_MAP_FILE
from portage.exception import CommandNotFound, FileNotFound, \
@@ -169,8 +168,8 @@ def _parse_color_map(config_root='/', onerror=None):
try:
lineno=0
for line in codecs.open(_unicode_encode(myfile,
- encoding=_fs_encoding, errors='strict'),
- mode='r', encoding=_content_encoding, errors='replace'):
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['content'], errors='replace'):
lineno += 1
commenter_pos = line.find("#")
@@ -470,7 +469,7 @@ class EOutput(object):
def _write(self, f, s):
if sys.hexversion < 0x3000000 and isinstance(s, unicode):
# avoid potential UnicodeEncodeError
- s = s.encode(_content_encoding, 'replace')
+ s = s.encode(_encodings['stdio'], 'backslashreplace')
f.write(s)
f.flush()