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

Nicht lesbare .fit-Dateien #20

Closed
Natenom opened this issue Nov 24, 2023 · 1 comment
Closed

Nicht lesbare .fit-Dateien #20

Natenom opened this issue Nov 24, 2023 · 1 comment
Milestone

Comments

@Natenom
Copy link

Natenom commented Nov 24, 2023

Jede .fit-Datei, die ich hier habe (vom Wahoo Elemnt Bolt v2) und auch alte Export von Strava von 2020 können nicht gelesen werden. Immer gibt es die unten genannten Fehlermeldungen.

Ich habe testweise via pipx das Tool fitdecode installiert und fitjson datei.fit funktioniert mit Dateien, die in geo-activity-playground nen Fehler verursachen.

Ich werde dir gleich eine der Dateien per E-Mail zuschicken.

2023-11-25 00:40:36 geo_activity_playground.importers.directory INFO Loading metadata file …
2023-11-25 00:40:36 geo_activity_playground.importers.directory INFO Parsing activity file Activities/a.fit …
Traceback (most recent call last):
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/bin/geo-activity-playground", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/__main__.py", line 76, in main
    options.func(options)
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/__main__.py", line 63, in <lambda>
    func=lambda options: webui_main(make_activity_repository(options.basedir))
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/__main__.py", line 82, in make_activity_repository
    import_from_directory()
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/importers/directory.py", line 35, in import_from_directory
    timeseries = read_activity(path)
                 ^^^^^^^^^^^^^^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/core/activity_parsers.py", line 56, in read_activity
    df = read_fit_activity(path, open)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/core/activity_parsers.py", line 13, in read_fit_activity
    for frame in fit:
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/fitdecode/reader.py", line 232, in __iter__
    yield from self._read_next()
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/fitdecode/reader.py", line 351, in _read_next
    self._read_header()
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/fitdecode/reader.py", line 414, in _read_header
    header_magic = self._read_struct('<2BHI4s')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/fitdecode/reader.py", line 822, in _read_struct
    chunk = self._read_bytes(unpacker.size)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/fitdecode/reader.py", line 830, in _read_bytes
    chunk = utils.blocking_read(self._fd, size)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/fitdecode/utils.py", line 171, in blocking_read
    chunk = istream.read(-1 if size < 0 else size - len_read)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xeb in position 2: invalid continuation byte

Bei einer anderen Datei ist die letzte Zeile der Fehlermeldung z. B.:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8c in position 22: invalid start byte

martin-ueding added a commit that referenced this issue Nov 26, 2023
martin-ueding added a commit that referenced this issue Nov 26, 2023
@martin-ueding martin-ueding added this to the 0.8.1 milestone Nov 26, 2023
@martin-ueding
Copy link
Owner

Es klappt jetzt mit deiner Datei. Ich hoffe, dass sich das dann entsprechend auf die anderen Dateien überträgt. Ist in der Git-Version jetzt verfügbar (eventuell Playground/Cache löschen). Kommt dann mit Release 0.8.1 raus.

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

2 participants