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.

Home Page:https://eclipse.org/tahu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python string unpacking broken again

rosstitmarsh opened this issue · comments

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.

Hi @rosstitmarsh, recently I did a PR that can solve that issue ( and others ). I'm waiting for the review-> #367

Fixed in #367