From 5d4e3396d203110d27486380bd85b33283ac9d01 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Tue, 28 Jun 2016 23:28:58 -0400 Subject: [PATCH 1/3] wrap a path in displayable_path in commands --- beets/ui/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index c352fe53d..523de31c8 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -772,7 +772,7 @@ class TerminalImportSession(importer.ImportSession): either an action constant or a TrackMatch object. """ print_() - print_(task.item.path) + print_(displayable_path(task.item.path)) candidates, rec = task.candidates, task.rec # Take immediate action if appropriate. From 159e24a14be709de789d65257f8b50124e535c30 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Tue, 28 Jun 2016 23:32:46 -0400 Subject: [PATCH 2/3] only decode decarg results on python 2 --- beets/ui/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 807219b43..e9175fb7f 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -122,9 +122,12 @@ def _arg_encoding(): def decargs(arglist): """Given a list of command-line argument bytestrings, attempts to - decode them to Unicode strings. + decode them to Unicode strings when running under Python 2. """ - return [s.decode(_arg_encoding()) for s in arglist] + if six.PY2: + return [s.decode(_arg_encoding()) for s in arglist] + else: + return arglist def print_(*strings, **kwargs): From bdbed1f6d9d3d2dfa92e6e061c967398baa1eb6a Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Tue, 28 Jun 2016 23:33:39 -0400 Subject: [PATCH 3/3] only decode input_ results on python 2 --- beets/ui/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index e9175fb7f..032143928 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -214,7 +214,10 @@ def input_(prompt=None): except EOFError: raise UserError(u'stdin stream ended while input required') - return resp.decode(_in_encoding(), 'ignore') + if six.PY2: + return resp.decode(_in_encoding(), 'ignore') + else: + return resp def input_options(options, require=False, prompt=None, fallback_prompt=None,