diff options
-rw-r--r-- | pym/portage/__init__.py | 11 | ||||
-rw-r--r-- | pym/portage/util.py | 4 |
2 files changed, 4 insertions, 11 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index df7961b14..8b9ac9012 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -686,17 +686,6 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, writemsg("!!! File Not Found: '%s'\n" % file_path, noiselevel=-1) continue - # TODO: Make getconfig() return unicode. - unicode_config = {} - for k, v in myconfig.iteritems(): - if not isinstance(k, unicode): - k = unicode(k, encoding='utf8', errors='replace') - if not isinstance(v, unicode): - v = unicode(v, encoding='utf8', errors='replace') - unicode_config[k] = v - myconfig = unicode_config - del unicode_config - config_list.append(myconfig) if "SPACE_SEPARATED" in myconfig: space_separated.update(myconfig["SPACE_SEPARATED"].split()) diff --git a/pym/portage/util.py b/pym/portage/util.py index 0a8035de6..df66723ec 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -447,6 +447,10 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True): raise portage.exception.CorruptionError("ParseError: Unexpected EOF: "+str(mycfg)+": line "+str(lex.lineno)) else: return mykeys + if not isinstance(key, unicode): + key = unicode(key, encoding='utf_8', errors='replace') + if not isinstance(val, unicode): + val = unicode(val, encoding='utf_8', errors='replace') if expand: mykeys[key] = varexpand(val, expand_map) expand_map[key] = mykeys[key] |