donadigo / pygbx

A Python library to parse Gbx files
GNU General Public License v3.0
38 stars 14 forks source link

Added file closing functionality and added another unicode validation #13

Closed malun22 closed 2 years ago

malun22 commented 2 years ago

In case an error is raised when creating a GBX object the file connection is not being closed which is required, if you want to continue working on the file (e.g. deleting it).

Also when I tried to import an exe file, it failed raising the GbxLoadError, because it could not decode as utf-8. That's why I added another try block to potentially raise an GbxLoadError.

malun22 commented 2 years ago

The style changes are not intended, I am sorry. My auto formatter created them. I though about deleting the pull request again and create a new one without those. Should I?

I did not see that f might not exists at this point. If it's not existent, doing nothing should be fine.

I have not worked with contexts yet, but sounds interesting.

donadigo commented 2 years ago

Sure thing. Do what's most comfortable for you,