In Python, when attempting to close a previously closed file handle, it simply seg faults, instead of catching and returning an error. This results in losing the Python session and work built up till then.
Steps to reproduce
In [1]: import adios2 as ad
In [2]: fm = ad.open('xgc.mesh.bp','r')
In [3]: RZ = fm.read('/coordinates/values')
In [4]: fm.close()
In [5]: fm.close()
[1] 115484 segmentation fault (core dumped) ipython
Expected behavior
Catch whether a file handle is still valid, and if not and the user attempts to close(), return a ValueError: Not a file id instead
Desktop (please complete the following information):
@pnorbert @rmchurch this is my fault. The Python API is not entirely safe. A check for m_Stream is required in every operation of File. Hope this helps.
In Python, when attempting to close a previously closed file handle, it simply seg faults, instead of catching and returning an error. This results in losing the Python session and work built up till then.
Steps to reproduce
Expected behavior Catch whether a file handle is still valid, and if not and the user attempts to close(), return a
ValueError: Not a file id
insteadDesktop (please complete the following information):