eclipse / tahu

Eclipse Tahu addresses the existence of legacy SCADA/DCS/ICS protocols and infrastructures and provides a much-needed definition of how best to apply MQTT into these existing industrial operational environments.
https://eclipse.org/tahu
Eclipse Public License 2.0
221 stars 129 forks source link

Python string unpacking broken again #366

Closed rosstitmarsh closed 6 months ago

rosstitmarsh commented 7 months ago

If the array has any any 0 length strings at the start or the end, the strip function on line 129 in convert_from_packed_string_array removes them.

e.g.

a = ["", "foo", "", "", "bar", "", ""]
convert_from_packed_string_array(convert_to_packed_string_array(a))
# returns ["foo", "", "", "bar"]

Replacing strip with removesuffix would work in python >=3.9 or removing the strip and putting the [:-1] back on the end.

Alain-Godo commented 7 months ago

Hi @rosstitmarsh, recently I did a PR that can solve that issue ( and others ). I'm waiting for the review-> https://github.com/eclipse/tahu/pull/367

Alain-Godo commented 7 months ago

image

rosstitmarsh commented 6 months ago

Fixed in #367