summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/__init__.py2
-rw-r--r--pym/portage/dbapi/porttree.py2
-rw-r--r--pym/portage/dbapi/vartree.py5
3 files changed, 8 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index d78491c4d..3a969bbce 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -246,6 +246,8 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli
raise portage.exception.PermissionDenied(mypath)
ftype = []
for x in list:
+ if not isinstance(x, unicode):
+ x = unicode(x, errors='replace')
try:
if followSymlinks:
pathstat = os.stat(mypath+"/"+x)
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index e29377f72..1fd593811 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -873,6 +873,8 @@ class portdbapi(dbapi):
except OSError:
continue
for x in file_list:
+ if not isinstance(x, unicode):
+ x = unicode(x, errors='replace')
pf = None
if glep55:
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 486439718..d92bdf9ef 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -894,6 +894,8 @@ class vardbapi(dbapi):
returnme = []
for x in dir_list:
+ if not isinstance(x, unicode):
+ x = unicode(x, errors='replace')
if self._excluded_dirs.match(x) is not None:
continue
ps = pkgsplit(x)
@@ -925,7 +927,8 @@ class vardbapi(dbapi):
else:
def listdir(p, **kwargs):
try:
- return [x for x in os.listdir(p) \
+ return [isinstance(x, unicode) and x or \
+ unicode(x, errors='replace') for x in os.listdir(p) \
if os.path.isdir(os.path.join(p, x))]
except EnvironmentError, e:
if e.errno == PermissionDenied.errno: