Bug #1489

Selection of new fundamental converters breaks existing programs

Added by J. Wienke almost 11 years ago. Updated almost 11 years ago.

Status:ResolvedStart date:05/07/2013
Priority:HighDue date:
Assignee:J. Moringen% Done:

100%

Category:Python
Target version:rsb-0.9

Description

The new fundamental converters in python break existing programs as the selection is now different, and e.g. communication with bag fails.

Attached is a proposed patch by Jan for this problem.

0001-Fix-dynamic-converter-selection-for-numeric-types.patch Magnifier (6.68 KB) J. Wienke, 05/07/2013 01:57 PM

Associated revisions

Revision 041a9ed1
Added by J. Moringen almost 11 years ago

Register converter subset, choose most specific converter in rsb/converter.py

refs #1489

  • rsb/converter.py: when registering builtin converters, skip the ones
    which would introduce ambiguity into the default converter set; when
    selecting converters, use most specific one in case of multiple
    candidates; this guarantees usage of int64 converter (instead of
    double converter) for integers

Revision b8b52ec4
Added by J. Moringen almost 11 years ago

Changed converter priority in src/configuration.lisp

refs #1489

  • src/configuration.lisp (default-converters): prioritize int64
    converter over all other integer converters, all integer converters
    over all float converters and double float converter over single
    float converter

History

#1 Updated by J. Wienke almost 11 years ago

Verdict: We want the same defaults for all languages. This means there is one int and one float type that is consistently chosen as a default in all languages.

  • int: signed 64 bit
  • floating point: double

#2 Updated by J. Wienke almost 11 years ago

  • For python this means: only register the converters for these types
  • For C++: Clients are obliged to use these client types, we could think of removing the registration of all other converters for other types
  • Java: no one knows

#3 Updated by J. Moringen almost 11 years ago

  • Status changed from New to In Progress

#4 Updated by J. Moringen almost 11 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100

Should be fixed in rsb-python and rsb-cl.

rsb-python now registers only a subset of the available builtin converters as described above. In addition, more specific converters are prioritized over less specific ones. This is necessary to ensure that integer values are handled by the int64 converter and not the double float converter (which can handle all values which are real numbers).

@Johannes: Please test with a recently built version of the RSBag tools. But note that the tools are currently (2013-06-05) not built for MacOS since the slave is down.

#5 Updated by J. Moringen almost 11 years ago

@Johannes: did you test this already? Please report results once you do.

#6 Updated by J. Moringen almost 11 years ago

@Johannes: you tested in your setup, right? did it work?

#7 Updated by J. Wienke almost 11 years ago

  • Status changed from Feedback to Resolved

At least python and bag-play talk to each other again. That was the test case I had, which didn't work before.

Also available in: Atom PDF