Closed ENAC-Robotique closed 1 year ago
Thanks for reporting, I can reproduce. It seems to be an issue only with the callbacks, not when calling receive!
See https://docs.python.org/3/c-api/arg.html#building-values
y# (bytes) [const char *, Py_ssize_t] This converts a C string and its lengths to a Python object. If the C string pointer is NULL, None is returned.
The pointer passed to build the value in the callback might be null, in case that the size is 0. https://github.com/eclipse-ecal/ecal/blob/6fc81d074bc3d5918df8378e56c6bb3134a26e95/lang/python/core/src/ecal_wrap.cxx#L592
I guess your quick fix might be the actual solution, since I haven't found anything that can create a 0 length byte array (and I don't think it makes sense to let the pointer point to arbitrary memory...)
Problem Description
Using the python bindings, I get this error when receiving a message with only default values (e.g. only 0):
I temporarily "solved" the issue by inserting these 2 lines at line 131 (https://github.com/eclipse-ecal/ecal/blob/master/lang/python/core/ecal/core/subscriber.py#L131):
How to reproduce
How did you get eCAL?
Ubuntu PPA (apt-get)
Environment
eCAL System Information