summaryrefslogtreecommitdiffstats
path: root/pym/portage/cache/ebuild_xattr.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-11 23:00:42 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-11 23:00:42 +0000
commite6ab16f4920e0f426c3096470c35dde22dc15de6 (patch)
tree01094d8cf54623078fafd08fd0b701f27543c390 /pym/portage/cache/ebuild_xattr.py
parent268de910a8e459125c12c6f7eaab1a59d59c2a0e (diff)
downloadportage-e6ab16f4920e0f426c3096470c35dde22dc15de6.tar.gz
portage-e6ab16f4920e0f426c3096470c35dde22dc15de6.tar.bz2
portage-e6ab16f4920e0f426c3096470c35dde22dc15de6.zip
Update imports to import portage.os (with unicode wrappers), and use
_unicode_encode() and _unicode_decode() where appropriate. svn path=/main/trunk/; revision=14002
Diffstat (limited to 'pym/portage/cache/ebuild_xattr.py')
-rw-r--r--pym/portage/cache/ebuild_xattr.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/pym/portage/cache/ebuild_xattr.py b/pym/portage/cache/ebuild_xattr.py
index 98e848651..baba94321 100644
--- a/pym/portage/cache/ebuild_xattr.py
+++ b/pym/portage/cache/ebuild_xattr.py
@@ -9,8 +9,8 @@ __all__ = ['database']
from portage.cache import fs_template
from portage.versions import catsplit
from portage import cpv_getkey
-from portage.util import writemsg
-import os
+from portage import os
+from portage import _unicode_decode
import xattr
from errno import ENODATA,ENOSPC,E2BIG
@@ -154,14 +154,9 @@ class database(fs_template.FsBased):
def __iter__(self):
- 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 root, dirs, files in os.walk(self.portdir):
for file in files:
+ file = _unicode_decode(file)
if file[-7:] == '.ebuild':
cat = os.path.basename(os.path.dirname(root))
pn_pv = file[:-7]