Follow-up from "Resolve "H5Parser method to close files""
The following discussion from !51 (merged) should be addressed:
-
@frey_m started a discussion: (+12 comments) @snuverink_j I get an error when
H5Parser.close
is called. My script only loads a H5 file and calls the print function. I use the h5py version 2.10.0. Have you experienced any error like this?Exception ignored in: <bound method H5Dataset.__del__ of <opal.datasets.H5Dataset.H5Dataset object at 0x7f08da008f98>> Traceback (most recent call last): File "/home/matthias/Documents/projects/pyOPALTools/opal/datasets/H5Dataset.py", line 98, in __del__ File "/home/matthias/Documents/projects/pyOPALTools/opal/parser/H5Parser.py", line 59, in close File "/home/matthias/Documents/projects/pyOPALTools/pyOPALTools.venv/lib/python3.5/site-packages/h5py/_hl/files.py", line 432, in close File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 267, in h5py.h5f.get_obj_ids File "h5py/h5i.pyx", line 37, in h5py.h5i.wrap_identifier SystemError: Parent module 'h5py' not loaded, cannot perform relative import
Possible fix:
Replacing the line self.__h5f.close()
in H5Parser.close
by del self.__h5f
.