Skip to content

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

Closed

Description

@sanderroosendaal

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

Activity

  1. sanderroosendaal commented on Apr 23, 2018

    @sanderroosendaal
    Author

    My last successful build was 12 days ago

  2. xmedeko commented on Apr 24, 2018

    @xmedeko
    Contributor

    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?).

  3. sanderroosendaal commented on Apr 24, 2018

    @sanderroosendaal
    Author

    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.

  4. xmedeko commented on Apr 24, 2018

    @xmedeko
    Contributor

    What exact version returns python --version ?

  5. sanderroosendaal commented on Apr 24, 2018

    @sanderroosendaal
    Author

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

  6. Repository owner deleted a comment from sanderroosendaal on Apr 24, 2018
  7. xmedeko commented on Apr 24, 2018

    @xmedeko
    Contributor

    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.

  8. pR0Ps commented on Apr 24, 2018

    @pR0Ps
    Collaborator
  9. xmedeko commented on Apr 25, 2018

    @xmedeko
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions