xzos / PyZDDE

Zemax/ OpticStudio Extension using Python
MIT License
154 stars 64 forks source link

Closing ZRD file before raising Exception in pyzdde.zfileutils.readZRDFile #90

Open jburgalat opened 5 years ago

jburgalat commented 5 years ago

Hi,

First of all thanks for the great amount of work done here !

I'd just want to report an easy fixable issue:

readZRDFile() from zfileutils.py does not close the file handle before raising the NotImplementedError in case the ZRD file is not uncompressed.

I think it should be done before raising the exception as the file remains locked. If one tries to update the ZRD (for instance calculating ray tracing from Zemax) she will have some trouble with a message box prompting that the file cannot be saved.

Best regards, Jérémie.