From a38b55281d40ed01ecbff49e24ae2f4939865cef Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 14 Aug 2009 20:19:16 +0000 Subject: [PATCH] Convert scanmacho/readpecoff output to unicode inside LinkageMapXXXXXX.rebuild(). svn path=/main/branches/prefix/; revision=14036 --- pym/portage/dbapi/vartree.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index d6d6f878f..18a9533f0 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -856,6 +856,8 @@ class LinkageMapMachO(object): raise CommandNotFound(args[0]) else: for l in proc.stdout: + if not isinstance(l, unicode): + l = unicode(l, encoding='utf_8', errors='replace') l = l.rstrip("\n") if not l: continue @@ -1323,7 +1325,7 @@ class LinkageMapPeCoff(LinkageMap): if self._dbapi.plib_registry and self._dbapi.plib_registry.getPreservedLibs(): args = ["readpecoff", self._dbapi.settings.get('CHOST')] for items in self._dbapi.plib_registry.getPreservedLibs().values(): - args.extend(os.path.join(root, x.lstrip("." + os.sep)) \ + args.extend(os.path.join(root, x.lstrip("." + os.path.sep)) \ for x in items) try: proc = subprocess.Popen(args, stdout=subprocess.PIPE) @@ -1333,6 +1335,8 @@ class LinkageMapPeCoff(LinkageMap): raise CommandNotFound(args[0]) else: for l in proc.stdout: + if not isinstance(l, unicode): + l = unicode(l, encoding='utf_8', errors='replace') l = l.lstrip().rstrip() if not l: continue -- 2.26.2