use text_string() in a few places for io output

This commit is contained in:
Johnny Robeson 2016-07-01 22:48:18 -04:00
parent 45727c56e2
commit 9020dc1f45
3 changed files with 3 additions and 3 deletions

View file

@ -73,7 +73,7 @@ class KeyFinderPlugin(BeetsPlugin):
key_raw = output.rsplit(None, 1)[-1]
try:
key = key_raw.decode('utf8')
key = util.text_string(key_raw)
except UnicodeDecodeError:
self._log.error(u'output is invalid UTF-8')
continue

View file

@ -431,7 +431,7 @@ class TestHelper(object):
def run_with_output(self, *args):
with capture_stdout() as out:
self.run_command(*args)
return out.getvalue().decode('utf-8')
return util.text_string(out.getvalue())
# Safe file operations

View file

@ -1013,7 +1013,7 @@ class ShowChangeTest(_common.TestCase):
autotag.AlbumMatch(album_dist, info, mapping, set(), set()),
)
# FIXME decoding shouldn't be done here
return self.io.getoutput().lower().decode('utf8')
return util.text_string(self.io.getoutput().lower())
def test_null_change(self):
msg = self._show_change()