Backlog
Description
Describe the bug
HDF5DatasetFileHandler.open() stores an open file before looking up its data group. If that lookup fails, the file remains open and the handler rejects subsequent opens until explicitly closed.
Reproduction
import h5py
from isaaclab.utils.datasets import HDF5DatasetFileHandler
with h5py.File("invalid.hdf5", "w"):
pass
handler = HDF5DatasetFileHandler()
try:
handler.open("invalid.hdf5")
except KeyError:
pass
with h5py.File("invalid.hdf5", "w"):
passActual: HDF5 rejects truncation because the file remains open. Expected: release the file on failure and allow the handler to open a valid dataset.
System Info
main at ebf162a, macOS ARM64, Python 3.12, CPU. No Isaac Sim required.
Additional context
Keep the file and group local until initialization succeeds, closing the file if initialization raises. The regression reproduces the retained open file and verifies subsequent reuse. All six HDF5 handler tests passed after the correction.
Checklist
- Checked for similar issues and PRs.
- Reproduced without Isaac Sim.
Metadata
Metadata
Assignees
Labels
No labels
Activity