From 71ae1fbca310c60cca7269aed66452c1d57fa6b2 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Mon, 9 Feb 2015 14:50:09 +0000 Subject: [PATCH] 8344: Ensure key is correct type when updating reference map --- gramps/gen/db/write.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/gen/db/write.py b/gramps/gen/db/write.py index 7fbb3daa0..b5334005d 100644 --- a/gramps/gen/db/write.py +++ b/gramps/gen/db/write.py @@ -1235,7 +1235,11 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): existing_references = set() primary_cur = self.get_reference_map_primary_cursor() try: - ret = primary_cur.set(handle) + if isinstance(handle, UNITYPE): + key = handle.encode('utf-8') + else: + key = handle + ret = primary_cur.set(key) except: ret = None