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

Issue with end of file parsing #93

Open
kobrien18 opened this issue Jun 27, 2019 · 3 comments
Open

Issue with end of file parsing #93

kobrien18 opened this issue Jun 27, 2019 · 3 comments

Comments

@kobrien18
Copy link

I am attempting to use fitparse to pull data from a RunScribe .fit file, and am running into an error at the end of the file:
fitparse.utils.FitEOFError: Tried to read 2 bytes from .FIT file but got 1

I do not run into this issue with a Garmin .fit file. I'm using Python 3.7 on Windows 10 (64-bit) and I've attached the simplest version of the files that I believe will recreate the error.

Please let me know if there's any simple resolution to this issue, thank you!

FitParse.zip

@suttondaniel
Copy link

I too am having this exact issue.

@pR0Ps
Copy link
Collaborator

pR0Ps commented Aug 11, 2020

I don't know what to make of that file - it's almost like it's corrupt or missing some data somehow. I see a file_id definition, a file_id data record (which looks fine), 5 unknown definitions, then everything else is an unknown record with unknown data in it until it errors out.

Does it parse with the FIT SDK from Garmin?

@fundthmcalculus
Copy link

fundthmcalculus commented Nov 1, 2021

I have written a patch with fault-tolerance for improperly terminated files. Your sample files seem to have missing header definitions, which means you cannot parse the file. I will see what I can find.
https://github.com/fundthmcalculus/python-fitparse/tree/unterminated-file-fix

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

4 participants