From b9464d1ea48b0f7531242d03c5cef1a6003f0470 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 1 May 2016 18:26:06 +0100 Subject: [PATCH] Use unicode for command formatting --- beetsplug/hook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beetsplug/hook.py b/beetsplug/hook.py index 81fb9a7f9..2b0bf2b0a 100644 --- a/beetsplug/hook.py +++ b/beetsplug/hook.py @@ -47,7 +47,9 @@ class HookPlugin(BeetsPlugin): self._log.error('invalid command "{0}"', command) return - formatted_command = command.format(event=event, **kwargs) + unicode_command = command.decode('utf-8') + formatted_command = unicode_command.format(event=event, + **kwargs) encoded_command = formatted_command.decode(_arg_encoding()) command_pieces = shlex.split(encoded_command)