Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'distance' #24

Closed
RobinTH90 opened this issue Sep 1, 2020 · 0 comments
Closed

KeyError: 'distance' #24

RobinTH90 opened this issue Sep 1, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@RobinTH90
Copy link

RobinTH90 commented Sep 1, 2020

Hi,

was tracking a "free training" session today with my Huawei Watch GT2. So the tracked session only contains time and heart rate and no distance. Trying to convert gets me an error:

C:\Users\Robin\Desktop\Hitrava-3.5.3>python Hitrava.py --file C:\Users\Robin\Desktop\Hitrava-3.5.3\HiTrack_1598967061000159896887100030001
2020-09-01 16:33:54,825 - INFO - main - Hitrava version 3.5.3 (build 2008.1801) started with arguments ['--file', 'C:\Users\Robin\Desktop\Hitrava-3.5.3\HiTrack_1598967061000159896887100030001']
2020-09-01 16:33:54,825 - INFO - main - Running on Python version 3.8.5
2020-09-01 16:33:54,827 - INFO - parse - Parsing file <C:\Users\Robin\Desktop\Hitrava-3.5.3\HiTrack_1598967061000159896887100030001>
2020-09-01 16:33:54,830 - ERROR - generate_xml - Error generating TCX XML content for activity <HiTrack_1598967061000159896887100030001>
'distance'
Traceback (most recent call last):
File "Hitrava.py", line 1451, in generate_xml
self._generate_walk_run_cycle_xml_data(el_activity)
File "Hitrava.py", line 1513, in _generate_walk_run_cycle_xml_data
el_lap = self._generate_lap_header_xml_data(el_activity, segment)
File "Hitrava.py", line 1617, in _generate_lap_header_xml_data
el_distance_meters.text = str(segment['distance'])
KeyError: 'distance'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "Hitrava.py", line 1981, in
main()
File "Hitrava.py", line 1941, in main
tcx_activity.save(tcx_filename)
File "Hitrava.py", line 1642, in save
self.generate_xml()
File "Hitrava.py", line 1505, in generate_xml
raise Exception('Error generating TCX XML content for activity <%s>\n%s', self.hi_activity.activity_id, e)
Exception: ('Error generating TCX XML content for activity <%s>\n%s', 'HiTrack_1598967061000159896887100030001', KeyError('distance'))

worked fine so far with all my biking sessions with distance in it.
Thanks in advance

@CTHRU CTHRU self-assigned this Sep 1, 2020
@CTHRU CTHRU added the bug Something isn't working label Sep 1, 2020
@CTHRU CTHRU closed this as completed in e50048c Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants