Skip to content

Commit

Permalink
Merge pull request #11 from florisla/1-recover-broken-cn
Browse files Browse the repository at this point in the history
Recover from a broken Cn (by Michael Fox, ported to Python 3)
  • Loading branch information
cmars committed Jul 22, 2023
2 parents 120e548 + 1ad79f6 commit c5192ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pystdf/IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ def parse_records(self, count=0):
if len(fields) < len(recType.columnNames):
fields += [None] * (len(recType.columnNames) - len(fields))
self.send((recType, fields))
if header.len > 0:
print(
"Warning: Broken header. Unprocessed data left in record of type '%s'. Working around it." % recType.__class__.__name__,
file=sys.stderr,
)
self.inp.read(header.len)
header.len = 0
else:
self.inp.read(header.len)
if count:
Expand Down

0 comments on commit c5192ad

Please sign in to comment.