Skip to content

Raise FitError for an empty FIT file - #43

Merged
tabishm52 merged 1 commit into
mainfrom
raise-on-empty-fit-file
Sep 6, 2026
Merged

tabishm52 merged 1 commit into
mainfrom
raise-on-empty-fit-file

Conversation

@tabishm52

@tabishm52 tabishm52 commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • decode_fit now raises FitError for a zero-byte input, instead of silently returning empty frames.
  • Covers parse_fit and parse_fit_raw.

Test plan

  • New tests: zero bytes raises, 13 null bytes still raises the existing "not a fit file" error.
  • Full gate: pytest, ruff check, ruff format --check, pyright, pre-commit — all green.

A zero-byte file was parsed as an empty-but-successful activity instead
of an error, indistinguishable from a truncated download.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tabishm52
tabishm52 merged commit 5780d27 into main Sep 6, 2026
4 checks passed
@tabishm52
tabishm52 deleted the raise-on-empty-fit-file branch September 6, 2026 04:44
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

Successfully merging this pull request may close these issues.

1 participant