Open malun22 opened 2 years ago
I did little testing, it seems to work. But when you initialize it as before with g = Gbx(file) it's not getting closed anymore, since I removed the close function when raising the error. Or should we disable the usual initialization?
Re closing: The problem when initializing the object manually, and an GBXLoadError is raised, you are not able to close the connection manually, because the object is not completely initialized (g is None) but the file connection is still ongoing. You could close the connection on the Error object, but I don't think that is something which is recommended right?
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.
I removed all the format changes and I am looking into context functionality.