sysid/sse-starlette

UnicodeDecodeError

yukw777 opened this issue · 0 comments

I'm trying to use sse-starlette to stream raw bytes (e.g. live videos). I've noticed that EventSourceResponse tries to decode chunk for debug logging (

_log.debug(f"chunk: {chunk.decode()}")
and
_log.debug(f"ping: {ping.decode()}")
), which raises a UnicodeDecodeError as chunk in my case is binary. What would be the best way to fix it? Happy to send a PR based on your suggestion.