8344: Ensure key is correct type when updating reference map

This commit is contained in:
Nick Hall 2015-02-09 14:50:09 +00:00
parent 30d809ed17
commit 71ae1fbca3

View File

@ -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