You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Se la directory fname non esiste, python da' errore durante la creazione del file h5 in h5py.File(fname, 'a').
Errore:
Traceback (most recent call last):
File "/home/aavs/simone/aavs-system/python/utilities/skalab/skalab_subrack.py", line 188, in <lambda>
self.wg.qbutton_connect.clicked.connect(lambda: self.connect())
File "/home/aavs/simone/aavs-system/python/utilities/skalab/skalab_subrack.py", line 508, in connect
self.tlm_hdf = self.setup_hdf5()
File "/home/aavs/simone/aavs-system/python/utilities/skalab/skalab_subrack.py", line 475, in setup_hdf5
return h5py.File(fname, 'a')
File "/opt/aavs/python/lib/python3.8/site-packages/h5py/_hl/files.py", line 533, in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "/opt/aavs/python/lib/python3.8/site-packages/h5py/_hl/files.py", line 252, in make_fid
fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl)
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 126, in h5py.h5f.create
FileNotFoundError: [Errno 2] Unable to create file (unable to open file: name = '/storage/monitoring/subrack/subrack_tlm_2023-03-24_113931.h5', errno = 2, error message = 'File o directory non esistente', flags = 15, o_flags = c2)
Attuale metodo:
def setup_hdf5(self):
if not self.profile['SubRack']['data_path'] == "":
fname = self.profile['SubRack']['data_path']
if not fname[-1] == "/":
fname = fname + "/"
fname += datetime.datetime.strftime(datetime.datetime.utcnow(), "subrack_tlm_%Y-%m-%d_%H%M%S.h5")
return h5py.File(fname, 'a')
else:
msgBox = QtWidgets.QMessageBox()
msgBox.setText("Please Select a valid path to save the Subrack data and save it into the current profile")
msgBox.setWindowTitle("Error!")
msgBox.setIcon(QtWidgets.QMessageBox.Critical)
msgBox.exec_()
return None
Possibile soluzione:
def setup_hdf5(self):
if not self.profile['SubRack']['data_path'] == "":
fname = self.profile['SubRack']['data_path']
if not fname[-1] == "/":
fname = fname + "/"
if os.path.exists(str(Path.home()) + fname) != True:
os.makedirs(str(Path.home()) + fname)
fname += datetime.datetime.strftime(datetime.datetime.utcnow(), "subrack_tlm_%Y-%m-%d_%H%M%S.h5")
return h5py.File(str(Path.home()) + fname, 'a')
else:
msgBox = QtWidgets.QMessageBox()
msgBox.setText("Please Select a valid path to save the Subrack data and save it into the current profile")
msgBox.setWindowTitle("Error!")
msgBox.setIcon(QtWidgets.QMessageBox.Critical)
msgBox.exec_()
return None
The text was updated successfully, but these errors were encountered:
Se la directory fname non esiste, python da' errore durante la creazione del file h5 in
h5py.File(fname, 'a')
.Errore:
Attuale metodo:
Possibile soluzione:
The text was updated successfully, but these errors were encountered: