Python string unpacking broken again
rosstitmarsh opened this issue · comments
Ross Titmarsh commented
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 D. Godo Alonso commented
Hi @rosstitmarsh, recently I did a PR that can solve that issue ( and others ). I'm waiting for the review-> #367
Alain D. Godo Alonso commented
Ross Titmarsh commented
Fixed in #367