Skip to content

Commit 90479a4

Browse files
committed
convert root_uuid to str if it is not
1 parent 2d4d97b commit 90479a4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

h5json/hdf5db.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,14 +708,18 @@ def getNumLinksToObject(self, obj):
708708

709709
def getUUIDByPath(self, path):
710710
self.initFile()
711-
self.log.info("getUUIDByPath: [" + path + "]")
711+
self.log.info("getUUIDByPath: [[[" + path + "]")
712712
if len(path) >= 6 and path[:6] == '__db__':
713713
msg = "getUUIDByPath called with invalid path: [" + path + "]"
714714
self.log.error(msg)
715715
raise IOError(errno.EIO, msg)
716716
if path == '/':
717717
# just return the root UUID
718-
return self.dbGrp.attrs["rootUUID"]
718+
root_uuid = self.dbGrp.attrs["rootUUID"]
719+
if root_uuid and type(root_uuid) is not str:
720+
# convert bytes to unicode
721+
root_uuid = root_uuid.decode('utf-8')
722+
return root_uuid
719723

720724
obj = self.f[path] # will throw KeyError if object doesn't exist
721725
addr = h5py.h5o.get_info(obj.id).addr

0 commit comments

Comments
 (0)