Skip to content

Commit

Permalink
fix: seek to previous position instead of 0 after reading IVM
Browse files Browse the repository at this point in the history
  • Loading branch information
melsabagh authored and popematt committed Apr 10, 2023
1 parent 56cf39a commit b7b00f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion amazon/ion/simpleion.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ def load_python(fp, catalog=None, single_value=True, encoding='utf-8', cls=None,
if isinstance(fp, _TEXT_TYPES):
raw_reader = text_reader(is_unicode=True)
else:
pos = fp.tell()
maybe_ivm = fp.read(4)
fp.seek(0)
fp.seek(pos)
if maybe_ivm == _IVM:
raw_reader = binary_reader()
else:
Expand Down

0 comments on commit b7b00f0

Please sign in to comment.