From 54fdf3ef8a48711359d1a48e14cce4032b25165d Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 28 Oct 2014 14:08:35 +0000 Subject: [PATCH] 8020: Ensure that reference map has string keys --- gramps/gen/db/write.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gramps/gen/db/write.py b/gramps/gen/db/write.py index 9aa21bee0..7fbb3daa0 100644 --- a/gramps/gen/db/write.py +++ b/gramps/gen/db/write.py @@ -1311,7 +1311,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): """ if isinstance(key, tuple): #create a string key - key = str(key) + if sys.version_info[0] >= 3: + key= str(key) + else: + key = str(tuple(k.encode('utf-8') for k in key)) if isinstance(key, UNITYPE): key = key.encode('utf-8') if self.readonly or not key: