Menu

#611 URGENT fail to write attribute with PyTango 8.0.3

closed-fixed
nobody
PyTango
5
2013-08-28
2013-05-28
Sergi Rubio
No

This is bug is quite blocking as it causes problems with ALL our PyTango device servers.

The PyTango 8 documentation states the following:

<quote>
This is what you would do with PyTango <= 3.0.4:</quote>

flatList = []
attr.get_write_value(flatList)
print "flatList =", flatList

flatList = [ 1, 2, 3, 4 ]

You can still do it with PyTango 8. However I recommend:
...

Therefore attr.get_write_value(flatList) in PyTango 8.* should work, but it fails with the following exception:


PyDs_PythonError: ArgumentError: Python argument types in
WAttribute.get_write_value(WAttribute, list)
did not match C++ signature:
get_write_value(Tango::WAttribute {lvalue} self, PyTango::ExtractAs extract_as=PyTango._PyTango.ExtractAs.Numpy)


Having the old syntax allowed is critical to us; because this issue does not allow us to update Tango8 at all in any subsystem.

Sergi Rubio

Discussion

  • Emmanuel Taurel

    Emmanuel Taurel - 2013-06-06
    • Category: --> PyTango
     
  • Frédéric PICCA

    Hello Soleil is also affected by this problem.

    I am wondering if the culprite is not this commit 2012-09-04 10:03:56

    merge with branch Release_8_0_0_py3k

    where, this code was removed.

    ~~~~~~
    @@ -345,47 +437,6 @@ namespace PyWAttribute
    /// @{

     template<long tangoTypeConst>
    
    • void __get_write_value_pytango3(Tango::WAttribute &att, boost::python::list &seq)
    • {
    • typedef typename TANGO_const2type(tangoTypeConst) TangoScalarType;

    • const TangoScalarType *ptr;

    • long length = att.get_write_value_length();

    • att.get_write_value(ptr);

    • for (long l = 0; l < length; ++l)
    • {
    • seq.append(ptr[l]);
    • }
    • }

    • template<>
    • void __get_write_value_pytango3<tango::dev_string>(Tango::WAttribute &att,</tango::dev_string>
    • boost::python::list &seq)
    • {
    • const Tango::ConstDevString *ptr;

    • long length = att.get_write_value_length();

    • att.get_write_value(ptr);

    • for (long l = 0; l < length; ++l)
    • {
    • seq.append(ptr[l]);
    • }
    • }

    • inline void get_write_value_pytango3(Tango::WAttribute &att,
    • boost::python::list &value)
    • {
    • long type = att.get_data_type();
    • TANGO_CALL_ON_ATTRIBUTE_DATA_TYPE(type, __get_write_value_pytango3, att, value);
    • }


      -
    • template<long tangotypeconst="">
      void __get_write_value_scalar(Tango::WAttribute &att, boost::python::object* obj)
      {
      typedef typename TANGO_const2type(tangoTypeConst) TangoScalarType;
      @@ -404,33 +455,6 @@ namespace PyWAttribute
      ~~~~~</long>
     
  • Tiago Coutinho

    Tiago Coutinho - 2013-07-09

    Fixed in SVN branch PyTango_8_0_4_dev.
    Will become visible in next PyTango release 8.0.4

    Thanks for reporting.

     
  • Tiago Coutinho

    Tiago Coutinho - 2013-07-09
    • status: open --> open-fixed
     
  • Tiago Coutinho

    Tiago Coutinho - 2013-08-28
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB