[core + modules/cmus] Have another go at fixing unicode issues

Override sys.stdout and sys.stderr in an attempt to enforce utf-8
encoding. Probably this will cause all kinds of weird issues down the
line, but at least, it seems to solve the immediate issue.

fixes #176
This commit is contained in:
Tobias Witek 2017-09-16 12:22:20 +02:00
parent 8c3bd98424
commit dfb1e39421
2 changed files with 25 additions and 5 deletions

View file

@ -1,5 +1,4 @@
# pylint: disable=C0111,R0903
# -*- coding: utf-8 -*-
"""Displays information about the current song in cmus.
@ -69,10 +68,6 @@ class Module(bumblebee.engine.Module):
return returns.get(widget.name, self._status)
def _eval_line(self, line):
# not a typo, use decode detection to see whether we are
# dealing with Python2 or Python3
if hasattr(line, "decode"):
line = line.encode("utf-8", "replace")
name, key, value = (line.split(" ", 2) + [None, None])[:3]
if name == "status":