Skip to content

Commit aa47dd3

Browse files
committed
[h5group] make sure to convert np.str_ to python str for attribute values
1 parent 6721b8f commit aa47dd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nixio/hdf5/h5group.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ def set_attr(self, name, value):
250250
if name in self.group.attrs:
251251
del self.group.attrs[name]
252252
else:
253+
if isinstance(value, np.str_):
254+
value = str(value)
253255
self.group.attrs[name] = value
254256

255257
def get_attr(self, name):

0 commit comments

Comments
 (0)