python-fitparse icon indicating copy to clipboard operation
python-fitparse copied to clipboard

Error when updating profile version

Open pokey opened this issue 6 years ago • 5 comments

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

pokey avatar Jun 26 '18 09:06 pokey

See PR #74 is has SDK 20.66.

xmedeko avatar Jul 19 '18 05:07 xmedeko

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

pokey avatar Jul 19 '18 14:07 pokey

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

polyvertex avatar Jul 19 '18 20:07 polyvertex

Hmm just tried that, and still got the same error message

pokey avatar Aug 03 '18 09:08 pokey

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'

lin826 avatar Sep 01 '18 17:09 lin826