System Info
Robosuite version, Ubuntu 24.04
Information
I am receiving this warning from get_xml() in robosuite/utils/bindin_utils.py whenever get_state() is called
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/bho36/Documents/code/FILM/./robosuite/robosuite/utils/binding_utils.py:506: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmpt8nu028r/model.xml' mode='r' encoding='UTF-8'>
return open(filename).read()
My solution was to modify the code from this
def get_xml(self):
with TemporaryDirectory() as td:
filename = os.path.join(td, "model.xml")
ret = mujoco.mj_saveLastXML(filename.encode(), self._model)
return open(filename).read()
to this.
def get_xml(self):
with TemporaryDirectory() as td:
filename = os.path.join(td, "model.xml")
ret = mujoco.mj_saveLastXML(filename.encode(), self._model)
with open(filename) as f:
return f.read()
Reproduction
N/A
Expected behavior
No response
System Info
Information
I am receiving this warning from
get_xml()inrobosuite/utils/bindin_utils.pywheneverget_state()is calledMy solution was to modify the code from this
to this.
Reproduction
N/A
Expected behavior
No response