diff --git a/DFReader.py b/DFReader.py index 3e20ae367..2cbd5922a 100644 --- a/DFReader.py +++ b/DFReader.py @@ -192,7 +192,7 @@ def __getattr__(self, field): if self.fmt.msg_types[i] == str: v = null_term(v) if self.fmt.msg_mults[i] is not None and self._apply_multiplier: - v *= self.fmt.msg_mults[i] + v *= self.fmt.msg_mults[i] return v def __setattr__(self, field, value): @@ -1086,7 +1086,7 @@ def make_format_msgbuf(self, fmt): def DFReader_is_text_log(filename): '''return True if a file appears to be a valid text log''' with open(filename, 'r') as f: - ret = (f.read(8000).find('FMT,') != -1) + ret = (f.read(8000).find('FMT,') != -1) return ret @@ -1147,8 +1147,7 @@ def init_arrays(self, progress_callback=None): while ofs+16 < self.data_len: mtype = self.data_map[ofs:ofs+4] - if mtype[3] == b',': - mtype = mtype[0:3] + mtype = mtype.decode().rstrip(', ') if not mtype in self.offsets: self.counts[mtype] = 0 self.offsets[mtype] = []