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

FitParseError invalid field size 227 for type 'sint32' #64

Closed
sanderroosendaal opened this issue Apr 23, 2018 · 8 comments
Closed

FitParseError invalid field size 227 for type 'sint32' #64

sanderroosendaal opened this issue Apr 23, 2018 · 8 comments

Comments

@sanderroosendaal
Copy link

After upgrading fitparse to the latest (master branch), one of my standard test files fails to parse. This is a file produced by a NK SpeedCoach GPS 2 device. The file parses well on SportTracks, Strava, etc.

C:\Users\e408191\AppData\Local\Continuum\Anaconda2\lib\site-packages\fitparse\base.pyc in _parse_definition_message(self, header)
196 # examples in the wild. For now, just throw an exception
197 raise FitParseError("Invalid field size %d for type '%s' (expected a multiple of %d)" % (
--> 198 field_size, base_type.name, base_type.size))
199
200 # If the field has components that are accumulators

FitParseError: Invalid field size 227 for type 'sint32' (expected a multiple of 4)

3x250m.zip

@sanderroosendaal
Copy link
Author

My last successful build was 12 days ago

@xmedeko
Copy link
Contributor

xmedeko commented Apr 24, 2018

I've tried scripts\fitdump 3x250m.fit and it has processed without any error. What version of Python do you use? How to you use fitparse (e.g. do you use fitdump or your own python code?).

@sanderroosendaal
Copy link
Author

sanderroosendaal commented Apr 24, 2018

Here is some example code that gives the error (Python 2.7):

from fitparse import FitFile

f = '../testdata/3x250m.fit'
fitfile = FitFile(f,check_crc=False)
fitfile.parse()

When I git checkout 5d8bb3a everything is fine.

@xmedeko
Copy link
Contributor

xmedeko commented Apr 24, 2018

What exact version returns python --version ?

@sanderroosendaal
Copy link
Author

On my local system: Python 2.7.12 :: Anaconda 4.2.0 (64-bit)
On Travis-CLI - 2.7.10

Repository owner deleted a comment from sanderroosendaal Apr 24, 2018
@xmedeko
Copy link
Contributor

xmedeko commented Apr 24, 2018

Got the error on a different machine with Python 2.7.12 (do not understand, why my installation of 2.7.12 works): TypeError: The basestring type cannot be instantiated. Probably duplicate of #65

The error is caused by the str shim, already discussed in #58. @pR0Ps I will remove the shim from master, OK? I won't do any try_int, the caller (user) has to input proper type.

@pR0Ps
Copy link
Collaborator

pR0Ps commented Apr 24, 2018 via email

@xmedeko
Copy link
Contributor

xmedeko commented Apr 25, 2018

I've made a PR to fix this. Also, travis builds would make the contributing to this project much easier, see #40.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants