Writing an empty list of string produces a None value
Following up on issue #159 (closed).
Consider the following device:
from tango import AttrWriteType
from tango.server import Device, attribute
class Test(Device):
value = []
@attribute(
dtype=(str,),
max_dim_x=10,
access=AttrWriteType.READ_WRITE)
def test(self):
return self.value
@test.write
def test(self, value):
self.value = value
print("Writing", value)
running with:
$ python -m tango.test_context server.Test
Can't create notifd event supplier. Notifd event not available
Ready to accept request
Test started on port 8888 with properties {}
Device access: tango://hostname:8888/test/nodb/test#dbase=no
Server access: tango://hostname:8888/dserver/Test/test#dbase=no
and the following itango client:
In [1]: d = Device('tango://hostname:8888/test/nodb/test#dbase=no')
In [2]: d.test = []
This line gets printed on the server side:
Writing None
It should be:
Writing []
The None
value is likely to be produced here:
Although att.get_write_value
not affecting the NULL
pointer might indicate a problem on the client side.
This requires more investigation. Help would be greatly appreciated.
Edited by Anton Joubert