8020: Ensure that reference map has string keys

This commit is contained in:
Nick Hall 2014-10-28 14:08:35 +00:00
parent 9740e7fc0c
commit 54fdf3ef8a

View File

@ -1311,7 +1311,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
""" """
if isinstance(key, tuple): if isinstance(key, tuple):
#create a string key #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): if isinstance(key, UNITYPE):
key = key.encode('utf-8') key = key.encode('utf-8')
if self.readonly or not key: if self.readonly or not key: