From: Tomas Babej Date: Sat, 7 Jan 2017 19:10:59 +0000 (+0100) Subject: backend: Do not assume that all command arguments are (byte)strings X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/60ad4e9ca34e12a29de76170a8b6ca746742a174?ds=sidebyside;hp=-c backend: Do not assume that all command arguments are (byte)strings --- 60ad4e9ca34e12a29de76170a8b6ca746742a174 diff --git a/tasklib/backends.py b/tasklib/backends.py index 4b0c6df..e6daace 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -132,7 +132,10 @@ class TaskWarrior(Backend): overrides.update(config_override or dict()) for item in overrides.items(): command_args.append('rc.{0}={1}'.format(*item)) - command_args.extend([x.decode('utf-8') for x in args]) + command_args.extend([ + x.decode('utf-8') if isinstance(x, six.binary_type) + else six.text_type(x) for x in args + ]) return command_args def _get_version(self):