summaryrefslogtreecommitdiffstats
path: root/pym/portage/output.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-20 23:50:20 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-20 23:50:20 +0000
commit581381acffbedfdc553b9643d47924bf44e32238 (patch)
tree878d3777e6b79c5e0712e38f63505dc6e7079f21 /pym/portage/output.py
parent8c70715b17035030d5729972e01b2c2d3d842967 (diff)
downloadportage-581381acffbedfdc553b9643d47924bf44e32238.tar.gz
portage-581381acffbedfdc553b9643d47924bf44e32238.tar.bz2
portage-581381acffbedfdc553b9643d47924bf44e32238.zip
Always pass encodings='utf_8' to codecs.open(), since otherwise it can
return non-unicode strings (at least in some cases, observed with python-2.6.2). Don't use unicode in portage.util.getconfig() for now, since shlex doesn't seem to support it (spurious \0 characters). If we use unicode for config variables, it breaks shlex.split() calls on those variables due to the same issue (spurious \0 characters). svn path=/main/trunk/; revision=13845
Diffstat (limited to 'pym/portage/output.py')
-rw-r--r--pym/portage/output.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 4c533c427..eb0d247b7 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -165,7 +165,8 @@ def _parse_color_map(onerror=None):
return token
try:
lineno=0
- for line in codecs.open( myfile, mode = 'r', errors = 'replace' ):
+ for line in codecs.open( myfile, mode='r',
+ encoding='utf_8', errors='replace' ):
lineno += 1
commenter_pos = line.find("#")