I'm running PyTables 2.1.2 which HDF5 version 1.8.4. As I've mentioned earlier I have some code that has multiple file handles to a single file, one for writing, others for reading. I'm trying to refactor my code to avoid this, but I've stumbled across this bug.
In [1]: import tables In [2]: fyle = tables.openFile("foo.h5") In [3]: fyle2 = tables.openFile("foo.h5",mode="a") HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5F.c line 1512 in H5Fopen(): unable to open file major: File accessability minor: Unable to open file #001: H5F.c line 1241 in H5F_open(): file is already open for read-only major: File accessability minor: Unable to open file HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5F.c line 2477 in H5Fget_mdc_config(): not a file ID major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5F.c line 2530 in H5Fset_mdc_config(): not a file ID major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5Gdeprec.c line 293 in H5Gopen1(): not a location major: Invalid arguments to routine minor: Inappropriate type #001: H5Gloc.c line 241 in H5G_loc(): invalid object ID major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5Adeprec.c line 208 in H5Aopen_name(): not a location major: Invalid arguments to routine minor: Inappropriate type #001: H5Gloc.c line 241 in H5G_loc(): invalid object ID major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5G.c line 694 in H5Gclose(): not a group major: Invalid arguments to routine minor: Inappropriate type HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5Gdeprec.c line 293 in H5Gopen1(): not a location major: Invalid arguments to routine minor: Inappropriate type #001: H5Gloc.c line 241 in H5G_loc(): invalid object ID major: Invalid arguments to routine minor: Bad value --------------------------------------------------------------------------- HDF5ExtError Traceback (most recent call last) /scrap/afoglia/uni/<ipython console> in <module>() /usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/file.pyc in openFile(filename, mode, title, rootUEP, filters, nodeCacheSize, **kwargs) 228 229 # Finally, create the File instance, and return it --> 230 return File(filename, mode, title, rootUEP, filters, **kwargs) 231 232 /usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/file.pyc in __init__(self, filename, mode, title, rootUEP, filters, **kwargs) 518 519 # Get the root group from this file --> 520 self.root = root = self.__getRootGroup(rootUEP, title, filters) 521 # Complete the creation of the root node 522 # (see the explanation in ``RootGroup.__init__()``. /usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/file.pyc in __getRootGroup(self, rootUEP, title, filters) 563 # Create new attributes for the root Group instance and 564 # create the object tree --> 565 return RootGroup(self, rootUEP, title=title, new=new, filters=filters) 566 567 /usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/group.pyc in __init__(self, ptFile, name, title, new, filters) 1133 self._g_new(ptFile, name, init=True) 1134 # Open the node and get its object ID. -> 1135 self._v_objectID = self._g_open() 1136 1137 # Set disk attributes and read children names. /usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/hdf5Extension.so in tables.hdf5Extension.Group._g_open() HDF5ExtError: Can't open the group: '/'. In [4]: tables.file._open_files.keys() Segmentation fault (core dumped) If instead of tables.file._open_files.keys(), I simply do a Ctrl-D, I get the following errors: Closing remaining open files: Global/ASAAsset/1/Captured-2002.h5... done Global/ASAAsset/1/Captured-2002.h5... Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/file.py", line 2175, in close_open_files fileh.close() File "/usr/local/lib/python2.6/dist-packages/tables-2.1.2-py2.6-linux-x86_64.egg/tables/file.py", line 1985, in close self.root._f_close() AttributeError: 'File' object has no attribute 'root' Error in sys.exitfunc: HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0: #000: H5G.c line 694 in H5Gclose(): not a group major: Invalid arguments to routine minor: Inappropriate type Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group /',) in ignored [And then a barebones traceback from IPython ending with "AttributeError: 'File' object has no attribute 'root'"] I understand what I'm doing is not well accepted, but PyTables should be robust enough to handle it in a stable manner. (I don't even understand the "Can't open the group: '/'" error as the file obviously has one.) -- Anthony Foglia Princeton Consultants (609) 987-8787 x233 ------------------------------------------------------------------------------ _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users