mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
use text_string() in a few places for io output
This commit is contained in:
parent
45727c56e2
commit
9020dc1f45
3 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue