From: Zac Medico Date: Tue, 2 Mar 2010 19:48:56 +0000 (-0000) Subject: fix: python dbm module doesn't accept unicode as key (trunk r15286) X-Git-Tag: v2.1.8~197 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d6b1e760435126552356e07b028523f14ccb7406;p=portage.git fix: python dbm module doesn't accept unicode as key (trunk r15286) svn path=/main/branches/2.1.7/; revision=15525 --- diff --git a/pym/portage/cache/anydbm.py b/pym/portage/cache/anydbm.py index 6add2da60..33cedebbb 100644 --- a/pym/portage/cache/anydbm.py +++ b/pym/portage/cache/anydbm.py @@ -63,10 +63,10 @@ class database(fs_template.FsBased): def _getitem(self, cpv): # we override getitem because it's just a cpickling of the data handed in. - return pickle.loads(self.__db[cpv]) + return pickle.loads(self.__db[_unicode_encode(cpv)]) def _setitem(self, cpv, values): - self.__db[cpv] = pickle.dumps(values,pickle.HIGHEST_PROTOCOL) + self.__db[_unicode_encode(cpv)] = pickle.dumps(values,pickle.HIGHEST_PROTOCOL) def _delitem(self, cpv): del self.__db[cpv]