X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/42baab3573bc84a4663c538afb0280787db952f1..0b7eee0a63b5d15d2dbbba7d35cb9600c5b7bab1:/tasklib/task.py?ds=sidebyside diff --git a/tasklib/task.py b/tasklib/task.py index ba95662..ce915bf 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -677,7 +677,13 @@ class Task(TaskResource): "task: %s" % '\n'.join(id_lines)) # Circumvent the ID storage, since ID is considered read-only - self._data['id'] = int(id_lines[0].split(' ')[2].rstrip('.')) + identifier = id_lines[0].split(' ')[2].rstrip('.') + + # Identifier can be either ID or UUID for completed tasks + try: + self._data['id'] = int(identifier) + except ValueError: + self._data['uuid'] = identifier # Refreshing is very important here, as not only modification time # is updated, but arbitrary attribute may have changed due hooks