kjkjava / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
314 stars 134 forks source link

Error when exporting manually created files that are incomplete #11

Open cmmndy opened 8 years ago

cmmndy commented 8 years ago

I get an an error when extracting the downloaded zip file of a manually created event, where I (for example) forgot to add the event type. The downloaded zip file is then empty and unzipping it will not work. A simple workaround that does the trick for me (i.e. it ignores these cases) would be to add if os.stat(data_filename).st_size > 0: in line 300, before unzipping the file. Of course, it then completely ignores the file, but it will continue the bulk export.

ebrensi commented 8 years ago

I added this fix to my fork https://github.com/ebrensi/garmin-connect-export.git

of the project, which is a pending pull request https://github.com/kjkjava/garmin-connect-export/pull/15