if end > start:
strings.append(d[start:end])
if self._null_terminated:
- strings[-1] = strings[-1].split('\x00', 1)[0]
+ strings[-1] = strings[-1].split(b'\x00', 1)[0]
start = end
elif self._null_terminated:
- d = d.split('\x00', 1)[0]
+ d = d.split(b'\x00', 1)[0]
return d
while True:
PackedFileRecordHeader.byte_order = initial_byte_order
PackedFileRecordHeader.setup()
- b = buffer(f.read(PackedFileRecordHeader.size))
+ b = bytes(f.read(PackedFileRecordHeader.size))
if not b:
break
if len(b) < PackedFileRecordHeader.size:
header = PackedFileRecordHeader.unpack_from(b)
_LOG.debug(
'reordered version: {}'.format(header['version']))
- data = buffer(f.read(header['numDataBytes']))
+ data = bytes(f.read(header['numDataBytes']))
if len(data) < header['numDataBytes']:
raise ValueError(
('not enough data for the next record ({} < {})'