summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-10 07:12:28 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-10 07:12:28 +0000
commitae551558b72bd77f27f0e2cf7d40e9c885a0a9b9 (patch)
tree353bb021ff3206b05968eda7f5e8814e26336fcc
parentcfe10ade8c97a6257f9d572d2c47d2838353a3ea (diff)
downloadportage-ae551558b72bd77f27f0e2cf7d40e9c885a0a9b9.tar.gz
portage-ae551558b72bd77f27f0e2cf7d40e9c885a0a9b9.tar.bz2
portage-ae551558b72bd77f27f0e2cf7d40e9c885a0a9b9.zip
Bug #280962 - Fix broken path normalization inside
StaticFileSet.multiBuilder(). svn path=/main/trunk/; revision=13974
-rw-r--r--pym/portage/sets/files.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/pym/portage/sets/files.py b/pym/portage/sets/files.py
index f0b6fed58..b5ad9a05d 100644
--- a/pym/portage/sets/files.py
+++ b/pym/portage/sets/files.py
@@ -126,17 +126,18 @@ class StaticFileSet(EditablePackageSet):
except KeyError:
raise SetConfigError(_("Could not find repository '%s'") % match.groupdict()["reponame"])
- if isinstance(directory, unicode):
- # Avoid UnicodeDecodeError raised from
- # os.path.join when called by os.walk.
- directory_unicode = directory
- directory = directory.encode('utf_8', 'replace')
- else:
- directory_unicode = unicode(directory,
- encoding='utf_8', errors='replace')
-
if os.path.isdir(directory):
directory = normalize_path(directory)
+
+ if isinstance(directory, unicode):
+ # Avoid UnicodeDecodeError raised from
+ # os.path.join when called by os.walk.
+ directory_unicode = directory
+ directory = directory.encode('utf_8', 'replace')
+ else:
+ directory_unicode = unicode(directory,
+ encoding='utf_8', errors='replace')
+
for parent, dirs, files in os.walk(directory):
if not isinstance(parent, unicode):
parent = unicode(parent,