From 4aba4320e62b79f48d64449a9361885b440711af Mon Sep 17 00:00:00 2001 From: Bruno Cauet Date: Mon, 26 Jan 2015 23:47:12 +0100 Subject: [PATCH] Rollback ui.print_() auto-conv of args to string Since this raises problems the best is probably to maintain the base behaviour: expect byte strings or unicodes. --- beets/ui/__init__.py | 8 +------- beets/ui/commands.py | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 956eae41a..a6b7e5518 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -102,12 +102,6 @@ def print_(*strings): either bytes or unicode. """ if strings: - if not isinstance(strings[0], basestring): - try: - strings = map(unicode, strings) - except UnicodeError: - strings = map(bytes, strings) - if isinstance(strings[0], unicode): txt = u' '.join(strings) else: @@ -571,7 +565,7 @@ def show_model_changes(new, old=None, fields=None, always=False): # Print changes. if changes or always: - print_(old) + print_(format(old)) if changes: print_(u'\n'.join(changes)) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 4f2c017dc..34e8b7518 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -994,7 +994,7 @@ def update_items(lib, query, album, move, pretend): for item in items: # Item deleted? if not os.path.exists(syspath(item.path)): - ui.print_(item) + ui.print_(format(item)) ui.print_(ui.colorize('red', u' deleted')) if not pretend: item.remove(True)