erlport icon indicating copy to clipboard operation
erlport copied to clipboard

For those who might find it helpful. Applicable to python3 only

Open thomasdola opened this issue 7 years ago • 1 comments

screenshot from 2017-05-31 00-20-23

  • If we look closely to these tables -> columns for erlang binary() to python bytes() for [python3 only] vise versa.

  • This basically means that arguments of str() data type in erlang sent over to python functions will be converted to bytes() in python3.

  • So for python functions expecting arguments of str() data type, do not forget to convert the received arguments back to python string before using.

# gist ref decoded_args = locals() for arg_name, arg_value in locals().items(): if isinstance(arg_value, bytes): decoded_args[arg_name] = arg_value.decode("utf-8")

thomasdola avatar May 31 '17 00:05 thomasdola

why str -> list?

With that you cant tell apart the python string "123" and list [49,50,51].

georgfaust avatar Jun 29 '22 16:06 georgfaust