[read_properties] skip unrecognized tags
This commit is contained in:
parent
9e6f5a3365
commit
286f9e1949
1 changed files with 3 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
Functionality for reading/writing elements (geometry, text labels,
|
Functionality for reading/writing elements (geometry, text labels,
|
||||||
structure references) and associated properties.
|
structure references) and associated properties.
|
||||||
"""
|
"""
|
||||||
|
import io
|
||||||
from typing import IO, TypeVar
|
from typing import IO, TypeVar
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
@ -53,6 +54,8 @@ def read_properties(stream: IO[bytes]) -> dict[int, bytes]:
|
||||||
if key in properties:
|
if key in properties:
|
||||||
raise KlamathError(f'Duplicate property key: {key!r}')
|
raise KlamathError(f'Duplicate property key: {key!r}')
|
||||||
properties[key] = value
|
properties[key] = value
|
||||||
|
else:
|
||||||
|
stream.seek(size, io.SEEK_CUR)
|
||||||
size, tag = Record.read_header(stream)
|
size, tag = Record.read_header(stream)
|
||||||
return properties
|
return properties
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue