ValueError: subsection not found
dukeduck1984 opened this issue · comments
Kaiyuan commented
Hi,
I tried to parse a .fit file generated by a garmin watch (pls see the attached), and got ValueError: subsection not found. Below is the debug info output by Jupyter Notebook.
<ipython-input-7-79754fd0eedc> in __check_fit_type(self, path)
196
197 self.new_messages = []
--> 198 for field in data_messages:
199 field_name = field.name
200 #print(field_name)
~\Anaconda3\lib\site-packages\fitparse\base.py in get_messages(self, name, with_definitions, as_dict)
448 # If there are unparsed messages, yield those too
449 while not self._complete:
--> 450 message = self._parse_message()
451 if message and should_yield(message):
452 yield message.as_dict() if as_dict else message
~\Anaconda3\lib\site-packages\fitparse\base.py in _parse_message(self)
158 message = self._parse_definition_message(header)
159 else:
--> 160 message = self._parse_data_message(header)
161 if message.mesg_type is not None:
162 if message.mesg_type.name == 'developer_data_id':
~\Anaconda3\lib\site-packages\fitparse\base.py in _parse_data_message(self, header)
318 header.local_mesg_num))
319
--> 320 raw_values = self._parse_raw_values_from_data_message(def_mesg)
321 field_datas = [] # TODO: I don't love this name, update on DataMessage too
322
~\Anaconda3\lib\site-packages\fitparse\base.py in _parse_raw_values_from_data_message(self, def_mesg)
269 else:
270 # Otherwise, just scrub the singular value
--> 271 raw_value = base_type.parse(raw_value)
272
273 raw_values.append(raw_value)
~\Anaconda3\lib\site-packages\fitparse\records.py in parse_string(string)
334 def parse_string(string):
335 try:
--> 336 end = string.index(0x00)
337 except TypeError: # Python 2 compat
338 end = string.index('\x00')
ValueError: subsection not found
Kaiyuan commented
I updated the FIT SDK profile and the error has gone.