return info
def _zip_segment(self, zipfile, path, info, zip_info, index, version):
- prop_file = zipfile.open(os.path.join(
- 'segments', str(index), 'segment-header.properties'))
- prop = self._parse_params(prop_file.readlines())
- prop_file.close()
+ with Closing(zipfile.open(os.path.join(
+ 'segments', str(index), 'segment-header.properties'))
+ ) as f:
+ prop = self._parse_params(f.readlines())
expected_shape = (int(prop['force-segment-header']['num-points']),)
channels = []
if 'list' not in prop['channels']: