Comment 2 for bug 1857608

Revision history for this message
Wolfgang Rohdewald (wolfgang-rohdewald) wrote :

Same here. Worked with gpxviewer in Ubuntu 18.10, I don't know the version anymore. Now it is Debian bullseye with gpxviewer 1.0.1 and I cannot load anything anymore.

IMHO the real bug here is an absolutely useless error message. I had illegal gpx files before and I always had to reduce them until the error went away. Very frustrating.

After commenting out some code hiding exceptions in gpxviewer I finally got something useful:

ValueError: time data '2020-01-04T12:59:29.1Z' does not match format '%Y-%m-%dT%H:%M:%S%z'

The time 2020-01-04T12:59:29Z does work.

https://www.w3schools.com/XML/schema_dtypes_date.asp does allow fractions of seconds, the ValueError is wrong.

This bug was introduced with commit 55e0bf9347ef452540a17f8fdedb36fa48edec09
"Replace iso8601 class by strptime"

The commit does not state the reason for this change.

Please have look at parse_time in
https://github.com/tkrajina/gpxpy/blob/dev/gpxpy/gpxfield.py