diff --git a/pystdf/IO.py b/pystdf/IO.py index b1eb58a..ca66148 100644 --- a/pystdf/IO.py +++ b/pystdf/IO.py @@ -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: