ecmwf / eccodes-python

Python interface to the ecCodes GRIB/BUFR decoder/encoder
Apache License 2.0
113 stars 33 forks source link

Make sure temp files are removed #65

Closed emfdavid closed 2 years ago

emfdavid commented 2 years ago

Change temp file behavior to ensure files are unlinked (removed). Related to https://github.com/ecmwf/cfgrib/issues/283

FussyDuck commented 2 years ago

CLA assistant check
All committers have signed the CLA.

shahramn commented 2 years ago

Dear @emfdavid Thank you for your contribution. But one or more of the tests are failing. So cannot accept the pull request ( yet )

emfdavid commented 2 years ago

@shahramn thank you - I will take a look and see if I can get it fixed.

emfdavid commented 2 years ago

@shahramn I can fix this test, but I need to change the behavior.

It is asserting the the temp files are not temp files but actually survive the context manager, causing an exception if you try to open the same file again. With my change, the files are removed (unlinked) at the end of the with block.

Is this a feature which I can not change or a bug that I have solved?

emfdavid commented 2 years ago

These files are a feature not a bug.