diff options
Diffstat (limited to 'pym/portage/cache/ebuild_xattr.py')
-rw-r--r-- | pym/portage/cache/ebuild_xattr.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pym/portage/cache/ebuild_xattr.py b/pym/portage/cache/ebuild_xattr.py index 83ed8a783..98e848651 100644 --- a/pym/portage/cache/ebuild_xattr.py +++ b/pym/portage/cache/ebuild_xattr.py @@ -153,7 +153,14 @@ class database(fs_template.FsBased): return os.path.exists(self.__get_path(cpv)) def __iter__(self): - for root,dirs,files in os.walk(self.portdir): + + portdir = self.portdir + if isinstance(portdir, unicode): + # Avoid UnicodeDecodeError raised from + # os.path.join when called by os.walk. + portdir = portdir.encode('utf_8', 'replace') + + for root, dirs, files in os.walk(portdir): for file in files: if file[-7:] == '.ebuild': cat = os.path.basename(os.path.dirname(root)) |