Is there a reason why byte-like objects are not supported?
Suggested solution: Wrap the .encode("utf-8") in a try-except block that catches the attribute error in case the user passed bytes-like objects, see https://stackoverflow.com/a/34870210.
I would like to start working on a PR as soon as one of the developers (maybe @cboulay) confirms the issue and signs off on the suggested solution.
Motivation: Support for variable-length binary data is crucial for the upcoming Pupil Labs LSL Relay plugin changes.
The XDF format specification explicitly states support for
To my knowledge, the only supported variable-length type in
pylsl
ispylsl.cf_string
.The issue is that the
pylsl.StreamOutlet.push_sample()
implementation only accepts unicode strings. It does not support objects of typebytes
, etc.Is there a reason why byte-like objects are not supported?
Suggested solution: Wrap the
.encode("utf-8")
in a try-except block that catches the attribute error in case the user passed bytes-like objects, see https://stackoverflow.com/a/34870210.I would like to start working on a PR as soon as one of the developers (maybe @cboulay) confirms the issue and signs off on the suggested solution.
Motivation: Support for variable-length binary data is crucial for the upcoming Pupil Labs LSL Relay plugin changes.