Quoting myself from the github issue:
So I took a close, long and hard look at this, and came to the conclusion that I cannot do anything about this on my end.
The thing is, the class in question implements
io.RawBaseIO, which means I have to adhere to its API. Which means that it needs to operate on bytes (
str in Python 2,
bytes in Python 3), not unicode (
unicode in Python 2,
str in Python 3). If I start decoding stuff into unicode before passing it to
process_line I get into all kinds of troubles when further processing the result from that inside
read. I could turn it back into bytes, but that just screams trouble too...
The thing is, if you work on the file system level, you work with bytes in Python. You always have, their data type was just called
str in Python 2. Client code needs to recognize that. I try to make the py2/3 compat migration as painless as possible for plugins, but that's something I cannot do for them without breaking parts of OctoPrint.
So I'm leaving this as is but added some warnings to the code which should make it into the documentation. I'll also finally look into whipping up some kind of list of common pitfalls for plugin authors to refer to for the coming months of migrations. Should have done that already but other stuff was even more urgent.