Logging Unicode characters from Python generates errors

Hi Folks

I’m running your software for quite some while and I’m relly happy with it. Thanks!

Recently I ran into a problem with my home assistant installation. I have it installed in a Python Virtual Enviroment on my Raspi3 OSMC box. At some point in time, it started to generated errors when logging Unicode characters to the journalctl log. I opened the following issue on their ticket system:

I have found a solution to either pass on a Unicode string to the logging system, or to strip Unicode characters before sending it to the logging system. The former seems the more elegant way, but it throws the same error just within the logging system. The latter way seems a bit bulky.

Now, I am unsure, how to proceed with this and would like to ask your opinion: Should the underlying logging system (i.e. OSMC, journalctl, Python) be able to log Unicode characters? Or is there one (or more) bottleneck(s), which do(es) not support Unicode characters? If so: Where is the bottleneck?

Thanks for your support!

Andreas

Log data can even contain binary data. Try passing —all to journalctl

Thanks, Sam!

The error occurs when writing to the log already. But since journalctl should be able to handle UTF log entries, we’ll have to search for the bottleneck elsewhere.