8-bit clean bytearray in Python connector

2 posts / 0 new
Last post
Last seen: 3 months 1 week ago
Joined: 08/28/2023
Posts: 1
8-bit clean bytearray in Python connector

Python3 str type is unicode UTF-8 by default. The bytes or bytearray types are more appropriate to communicate with a peer expecting C strings. In the Connector Python binding, there is a lot of round-tripping between C strings and UTF-8 Python str. This has the possibility of corrupting data or throwing errors when the content is not meant to be UTF-8. On top of that, those operations are slow. There are lower-level and "native" functions within Connector, but I can't find much information about their semantics and best practices.

1. Is there public documentation of these lower-level interfaces?

2. What would be the best way to transmit 8-bit clean bytearrays from Python?

Howard's picture
Last seen: 3 days 2 hours ago
Joined: 11/29/2012
Posts: 545

The Python Connector was a stop-gap measure while we were developing a full Python API for DDS.  It is now available as an experimental product through RTI's rticommunity github.

Please see the documentation here:


and the repository here:


With the Python binding, all supported basic data types are well defined and mapped between all supported languages.  So, 8 bit bytes should be mapped as Octets in IDL and then the bindings to different languages will ensure interoperability.