summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMounir Lamouri <volkmar@gentoo.org>2010-01-30 14:11:13 +0000
committerMounir Lamouri <volkmar@gentoo.org>2010-01-30 14:11:13 +0000
commite38112ef95720a3c71fdc09b68493c810c22443f (patch)
treeabf0406aaeb7a8fb3e26c65f1c648588e621c18c
parent3b1fea64824744f06697ee23d3e6bf28721325b9 (diff)
downloadportage-e38112ef95720a3c71fdc09b68493c810c22443f.tar.gz
portage-e38112ef95720a3c71fdc09b68493c810c22443f.tar.bz2
portage-e38112ef95720a3c71fdc09b68493c810c22443f.zip
fix: python dbm module doesn't accept unicode as key
svn path=/main/trunk/; revision=15286
-rw-r--r--pym/portage/cache/anydbm.py4
1 files changed, 2 insertions, 2 deletions
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]