TypeError: can't compare offset-naive and offset-aware datetimes
See original GitHub issueI try to generate a poster with some gpx files extracted from my garmin account. I have downloaded the files using the proposed python script garmin-connect-export. Now, I get the following error:
Traceback (most recent call last):
File "~/GpxTrackPoster/venv/bin/create_poster", line 8, in <module>
sys.exit(main())
File "~/GpxTrackPoster/venv/lib/python3.7/site-packages/gpxtrackposter/cli.py", line 217, in main
tracks = loader.load_tracks(args.gpx_dir)
File "~/GpxTrackPoster/venv/lib/python3.7/site-packages/gpxtrackposter/track_loader.py", line 114, in load_tracks
return self._filter_and_merge_tracks(tracks)
File "~/GpxTrackPoster/venv/lib/python3.7/site-packages/gpxtrackposter/track_loader.py", line 169, in _filter_and_merge_tracks
tracks = self._merge_tracks(tracks)
File "~/GpxTrackPoster/venv/lib/python3.7/site-packages/gpxtrackposter/track_loader.py", line 176, in _merge_tracks
tracks = sorted(tracks, key=lambda t1: t1.start_time())
TypeError: can't compare offset-naive and offset-aware datetimes
Is something wrong with my gpx files? As said, they all come from the same source.
Thanks in advance, LT.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Can't compare naive and aware datetime.now() <= challenge ...
So the way I would solve this problem is to make sure the two datetimes are in the right timezone.
Read more >Comparing Datetimes in Python with and without Timezones
In this tutorial, we'll go over how to compare dates in Python, ... TypeError: can't compare offset-naive and offset-aware datetimes.
Read more >can't compare offset-naive and offset-aware datetimes - Reddit
I asked a question similar to this before but I didn't understand the answers given. What timezone were the bare timestamps taken in?...
Read more >PYTHON : django 1.4 - can't compare offset-naive ... - YouTube
PYTHON : django 1.4 - can't compare offset - naive and offset - aware datetimes [ Gift : Animated Search Engine ...
Read more >can't compare offset-naive and offset-aware datetimes #266
I'm using pypicloud with gcs storage and redis cache. When clicking "Rebuild package list" in the admin UI I'm getting TypeError: can't compare...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for Your quick reply!
The modification did work! I get some errors for only a few gpx files such as:
I have to have a closer look at these files.
Thanks a lot, cheers, LT
I checked the relevant gpx files - they were not “running” files but “cardio” without time info - so the error messages are reasonable.
Thanks for Your help and filing the pr!