Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13924 - main/trunk/pym/portage/dbapi
Date: Wed, 05 Aug 2009 18:46:47
Message-Id: E1MYlVe-0003sG-I3@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-08-05 18:46:46 +0000 (Wed, 05 Aug 2009)
3 New Revision: 13924
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.py
7 Log:
8 Fix UnicodeEncodeError in vardbapi._owners_cache._hash_str(), reported by
9 jlec on irc.
10
11
12 Modified: main/trunk/pym/portage/dbapi/vartree.py
13 ===================================================================
14 --- main/trunk/pym/portage/dbapi/vartree.py 2009-08-05 18:11:44 UTC (rev 13923)
15 +++ main/trunk/pym/portage/dbapi/vartree.py 2009-08-05 18:46:46 UTC (rev 13924)
16 @@ -1425,7 +1425,7 @@
17 h = self._new_hash()
18 # Always use a constant utf_8 encoding here, since
19 # the "default" encoding can change.
20 - h.update(s)
21 + h.update(s.encode('utf_8', 'replace'))
22 h = h.hexdigest()
23 h = h[-self._hex_chars:]
24 h = int(h, 16)