From dbe2b392c277eb9e64d111a5947223dc391f56e4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 14 Aug 2009 21:19:04 +0000 Subject: [PATCH] In dblink._unmerge_pkgfiles(), if the package appears to have been merged with a different value of sys.getfilesystemencoding(), fall back to utf_8 if appropriate. svn path=/main/trunk/; revision=14049 --- pym/portage/dbapi/vartree.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index d0a389ee5..10e48fc19 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2376,6 +2376,20 @@ class dblink(object): scheduler.scheduleYield() obj = normalize_path(objkey) + if os is _os_merge: + try: + _unicode_encode(obj, encoding=_merge_encoding, 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(obj, encoding='utf_8', errors='strict') + except UnicodeEncodeError: + pass + else: + os = portage.os + file_data = pkgfiles[objkey] file_type = file_data[0] statobj = None -- 2.26.2