diff --git a/klamath/elements.py b/klamath/elements.py index 9a12b7d..c0d5567 100644 --- a/klamath/elements.py +++ b/klamath/elements.py @@ -2,6 +2,7 @@ Functionality for reading/writing elements (geometry, text labels, structure references) and associated properties. """ +import io from typing import IO, TypeVar from collections.abc import Mapping from abc import ABCMeta, abstractmethod @@ -53,6 +54,8 @@ def read_properties(stream: IO[bytes]) -> dict[int, bytes]: if key in properties: raise KlamathError(f'Duplicate property key: {key!r}') properties[key] = value + else: + stream.seek(size, io.SEEK_CUR) size, tag = Record.read_header(stream) return properties