Skip to content

Commit 1a952d7

Browse files
committed
ENH: Make sure read_annot returns strings.
1 parent c68b468 commit 1a952d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nibabel/freesurfer/io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ def read_annot(filepath, orig_ids=False):
389389
ctab[i, 2] * (2 ** 16) +
390390
ctab[i, 3] * (2 ** 24))
391391

392+
# make sure names are strings, not bytes
393+
names = [n.decode('ascii') for n in names]
394+
392395
labels = labels.astype(np.int32)
393396

394397
if not orig_ids:

0 commit comments

Comments
 (0)