X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/b0013c774cf1667bbde77a5515984e27635dfc1f..1fdf3d38f89946c7fee2efecc7d0e84c6eb82774:/tasklib/task.py 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