diff --git a/doc/changes/devel/13268.bugfix.rst b/doc/changes/devel/13268.bugfix.rst new file mode 100644 index 00000000000..b7dd5e05ea2 --- /dev/null +++ b/doc/changes/devel/13268.bugfix.rst @@ -0,0 +1 @@ +Fixed bug where the file_id is not set when the file contains a directory at the end of the file, by `Théodore Papadopoulo`_. diff --git a/mne/_fiff/tag.py b/mne/_fiff/tag.py index 6a4636ef264..96fee81da20 100644 --- a/mne/_fiff/tag.py +++ b/mne/_fiff/tag.py @@ -363,7 +363,7 @@ def _read_dir_entry_struct(fid, tag, shape, rlims): """Read dir entry struct tag.""" pos = tag.pos + 16 entries = list() - for offset in range(1, tag.size // 16): + for offset in range(tag.size // 16): ent = _read_tag_header(fid, pos + offset * 16) # The position of the real tag on disk is stored in the "next" entry within the # directory, so we need to overwrite ent.pos. For safety let's also overwrite