X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/bf3ebdee73154eef706afd22e5700e0860587b9a..9bfb0acaeac5ebfc79ffdf18cc96857fade9a37e:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index e0e1040..dd90a28 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -262,8 +262,10 @@ class SerializingObject(object): # If the value is already localized, there is no need to change # time zone at this point. Also None is a valid value too. localized = value - elif isinstance(value, six.string_types): + elif (isinstance(value, six.string_types) + and self.warrior.version > VERSION_2_4_0): # For strings, use 'task calc' to evaluate the string to datetime + # available since TW 2.4.0 args = value.split() result = self.warrior.execute_command(['calc'] + args) naive = datetime.datetime.strptime(result[0], DATE_FORMAT_CALC) @@ -910,7 +912,7 @@ class TaskWarrior(object): else: error_msg = stdout.strip() raise TaskWarriorException(error_msg) - return stdout.strip().split('\n') + return stdout.rstrip().split('\n') def enforce_recurrence(self): # Run arbitrary report command which will trigger generation