Index: pym/portage/dbapi/vartree.py =================================================================== --- pym/portage/dbapi/vartree.py (revision 13920) +++ pym/portage/dbapi/vartree.py (working copy) @@ -1425,7 +1425,7 @@ h = self._new_hash() # Always use a constant utf_8 encoding here, since # the "default" encoding can change. - h.update(s) + h.update(s.encode('utf_8', 'replace')) h = h.hexdigest() h = h[-self._hex_chars:] h = int(h, 16)