diff options
Diffstat (limited to 'pym/portage/dbapi/vartree.py')
-rw-r--r-- | pym/portage/dbapi/vartree.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index c6374cdf9..52d48a70f 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1353,11 +1353,16 @@ class vardbapi(dbapi): if not hasattr(pkg, "getcontents"): pkg = self._dblink(pkg) root = self.root + if not isinstance(root, unicode): + root = unicode(root, encoding='utf_8', errors='replace') root_len = len(root) - 1 new_contents = pkg.getcontents().copy() removed = 0 for filename in paths: + if not isinstance(filename, unicode): + filename = unicode(filename, + encoding='utf_8', errors='replace') filename = normalize_path(filename) if relative_paths: relative_filename = filename @@ -2530,6 +2535,14 @@ class dblink(object): if the file is not owned by this package. """ + if not isinstance(filename, unicode): + filename = unicode(filename, + encoding='utf_8', errors='replace') + + if not isinstance(destroot, unicode): + destroot = unicode(destroot, + encoding='utf_8', errors='replace') + destfile = normalize_path( os.path.join(destroot, filename.lstrip(os.path.sep))) @@ -2712,6 +2725,8 @@ class dblink(object): new_contents = self.getcontents().copy() old_contents = self._installed_instance.getcontents() for f in sorted(preserve_paths): + if not isinstance(f, unicode): + f = unicode(f, encoding='utf_8', errors='replace') f_abs = os.path.join(root, f.lstrip(os.sep)) contents_entry = old_contents.get(f_abs) if contents_entry is None: @@ -3734,6 +3749,9 @@ class dblink(object): mydest = join(destroot, offset, x) # myrealdest is mydest without the $ROOT prefix (makes a difference if ROOT!="/") myrealdest = join(sep, offset, x) + if not isinstance(myrealdest, unicode): + myrealdest = unicode(myrealdest, + encoding='utf_8', errors='replace') # stat file once, test using S_* macros many times (faster that way) mystat = os.lstat(mysrc) mymode = mystat[stat.ST_MODE] |