From: Zac Medico Date: Wed, 5 Aug 2009 18:46:46 +0000 (-0000) Subject: Fix UnicodeEncodeError in vardbapi._owners_cache._hash_str(), reported by X-Git-Tag: v2.2_rc37~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fdc7d1a66c023e6af67046a0cd5d6d9f16caef7e;p=portage.git Fix UnicodeEncodeError in vardbapi._owners_cache._hash_str(), reported by jlec on irc. svn path=/main/trunk/; revision=13924 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 075f38b2b..b9dba438b 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1425,7 +1425,7 @@ class vardbapi(dbapi): 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)