labrad/pylabrad

data vault can't return parameters. Version conflict?

xiaoyuejin opened this issue · 1 comments

Python 3.9.8, pylabrad 0.98.2. Newest data vault server. Can save/load data, but can't load parameters.

Both get_parameter() and get_parameters() fail with the same error. Could it be a version conflict?

dv.get_parameters()
Traceback (most recent call last):

File "C:\Users\x~1\AppData\Local\Temp/ipykernel_9492/718891437.py", line 1, in
dv.get_parameters()

File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\client.py", line 65, in call
return f.result() if wait else f

File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\concurrent\futures_base.py", line 445, in result
return self.__get_result()

File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\concurrent\futures_base.py", line 390, in __get_result
raise self._exception

File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\concurrent.py", line 84, in wrapped
result = yield defer.maybeDeferred(func, *args, **kw)

Error: [Data Vault] Remote Traceback (most recent call last):
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\server.py", line 246, in request_handler
result = yield self._dispatch(setting.handleRequest, self, c.data, flat_data)
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\server.py", line 212, in dispatch
return func(*args, **kw)
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\decorators.py", line 180, in handleRequest
return self.func(server, c)
File "C:\LabRAD\LabRAT\labrad\servers\datavault\server.py", line 433, in get_parameters
params = tuple((name, dataset.getParameter(name)) for name in names)
File "C:\LabRAD\LabRAT\labrad\servers\datavault\server.py", line 433, in
params = tuple((name, dataset.getParameter(name)) for name in names)
File "C:\LabRAD\LabRAT\labrad\servers\datavault_init
.py", line 417, in getParameter
return self.data.getParameter(name, case_sensitive)
File "C:\LabRAD\LabRAT\labrad\servers\datavault\backend.py", line 614, in getParameter
return labrad_urldecode(self.dataset.attrs[keyname])
File "C:\LabRAD\LabRAT\labrad\servers\datavault\backend.py", line 58, in labrad_urldecode
t, data_bytes = T.unflatten(all_bytes, 'ss')
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\types\types.py", line 307, in unflatten
return t.unflatten(s, endianness)
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\types\types.py", line 979, in unflatten
return tuple(unflatten(s, t, endianness) for t in self.items)
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\types\types.py", line 979, in
return tuple(unflatten(s, t, endianness) for t in self.items)
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\types\types.py", line 307, in unflatten
return t.unflatten(s, endianness)
File "C:\LabRAD\WinPython 3.9.8.0\python-3.9.8.amd64\lib\site-packages\labrad\types\types.py", line 689, in unflatten
n = struct.unpack(endianness + 'i', s.get(4))[0]
struct.error: unpack requires a buffer of 4 bytes

This turned out to be a compatibility issue between Python 2 and Python 3.