Skip to content

Loading fails if DEL present in multi-line interval annotation #22

@mr-martian

Description

@mr-martian

The following TextGrid does not load:
DEL.TextGrid.txt

If either the DEL (ASCII 7f) character or the newline is removed from the annotation, the file loads fine, but if both are present I get

>>> tgt.io.read_textgrid('DEL.TextGrid')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/daniel/.local/lib/python3.8/site-packages/tgt/io3.py", line 51, in read_textgrid
    return read_long_textgrid(filename, stg, include_empty_intervals)
  File "/home/daniel/.local/lib/python3.8/site-packages/tgt/io3.py", line 158, in read_long_textgrid
    num_obj = int(get_attr_val(stg[index + 5]))
IndexError: list index out of range

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions