summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-23 07:25:40 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-23 07:25:40 +0000
commite62514e472185cfcc764f37b4b0cf757d062b663 (patch)
treedbd9f27775fdc552eba45b41f24c5591bb59b78e
parent9c592b26bd18d874a7213f4e8e9d3c02b8ffefe2 (diff)
downloadportage-e62514e472185cfcc764f37b4b0cf757d062b663.tar.gz
portage-e62514e472185cfcc764f37b4b0cf757d062b663.tar.bz2
portage-e62514e472185cfcc764f37b4b0cf757d062b663.zip
Bug #282306 - Inside dblink._find_libs_to_preserve(), fall back to utf_8
encoding if a path cannot be encoded under the user's chosen encoding. This fixes the traceback shown in bug 282115, comment #6. svn path=/main/trunk/; revision=14130
-rw-r--r--pym/portage/dbapi/vartree.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index aa74ed687..e6ed16498 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2717,6 +2717,23 @@ class dblink(object):
provider_nodes = set()
# Create provider nodes and add them to the graph.
for f_abs in old_contents:
+
+ if os is _os_merge:
+ try:
+ _unicode_encode(f_abs,
+ encoding=_encodings['merge'], errors='strict')
+ except UnicodeEncodeError:
+ # The package appears to have been merged with a
+ # different value of sys.getfilesystemencoding(),
+ # so fall back to utf_8 if appropriate.
+ try:
+ _unicode_encode(f_abs,
+ encoding=_encodings['fs'], errors='strict')
+ except UnicodeEncodeError:
+ pass
+ else:
+ os = portage.os
+
f = f_abs[root_len:]
if self.isowner(f, root):
continue