python-fitparse
python-fitparse copied to clipboard
Error when updating profile version
When trying to update the sdk version to 20.66.00, I get the following error:
> python scripts/generate_profile.py /path/to/fit-sdk.zip fitparse/profile.py
Traceback (most recent call last):
File "scripts/generate_profile.py", line 548, in <module>
main(xls, profile)
File "scripts/generate_profile.py", line 506, in main
xls_file, profile_version = get_xls_and_version_from_zip(input_xls_or_zip)
File "scripts/generate_profile.py", line 486, in get_xls_and_version_from_zip
archive.open('c/fit.h').read().decode(),
File "/Users/pokey/.pyenv/versions/3.6.5/lib/python3.6/zipfile.py", line 1352, in open
zinfo = self.getinfo(name)
File "/Users/pokey/.pyenv/versions/3.6.5/lib/python3.6/zipfile.py", line 1281, in getinfo
'There is no item named %r in the archive' % name)
KeyError: "There is no item named 'c/fit.h' in the archive"
I believe this is because the desired path is actually not at the root of the zip, but rather just below the top-level FitSDKRelease_20.66.00
directory
See PR #74 is has SDK 20.66.
Maybe I'm missing something in that PR, but I don't believe that fixes the problem at hand, which I believe will continue to be a problem when someone tries to update profile.py
again based on a newer version of the SDK
I do not have any issue with generate_profile.py
. Perhaps it's because I have the zip archive in the same directory?
$ python generate_profile.py FitSDKRelease_20.66.00.zip profile.py
Hmm just tried that, and still got the same error message
Replace two files' names in scripts/generate_profile.py may help. 'c/fit.h' to 'FitSDKRelease_xx.xx.00/c/fit.h' 'Profile.xls' to 'FitSDKRelease_xx.xx.00/Profile.xls'