Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Protect against DeviceAttribute without .value #917

Merged
merged 1 commit into from
May 27, 2019

Conversation

mrosanes
Copy link
Collaborator

DeviceAttribute is not providing .value in some cases.
This has been seen using PyTango 9.3.0 when trying to read empty
spectrums.

Protect against DeviceAttribute not providing .value.

DeviceAttribute is not providing .value in some cases.
This has been seen using PyTango 9.3.0 when trying to read empty
spectrums.

Protect against DeviceAttribute not providing .value.
@mrosanes
Copy link
Collaborator Author

Read empty spectrum fails on taurus using pytango 9.3.0

Root problem: PyTango 9.3.0 also fails on reading empty spectrums. Most probably this is already introduced in Tango C/C++.

This failure has been found when executing Sardana spock using PyTango 9.3.0

To reproduce the problem easily without using Sardana from ipython do (in a system with PyTango 9.3.0):

import tango
import taurus
d = tango.DeviceProxy("sys/tg_test/1")
d.short_spectrum = []
taurus.Attribute("sys/tg_test/1/short_spectrum").read()

This problem is related with tango-controls/pytango#271

This PR adds a protection in Taurus when DeviceAttribute does not provide .value

@cpascual cpascual added this to the Jul19 milestone May 27, 2019
@cpascual
Copy link
Member

Thanks,

Note that the fix of tango-controls/pytango#271 (in tango-controls/pytango#273) makes Tango C++ and PyTango differ in this respect, which is probably not a good permanent solution, so I would expect that the either the old (pre-9.3) behaviour is restored in Tango or that PyTango would end adapting to the new (backwards-incompatible) behaviour.

In either case, the changes in this PR would protect us.

@cpascual cpascual merged commit 3e84d12 into taurus-org:develop May 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants