GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
146 stars 27 forks source link

Tasklib broken on python 3.8 #67

Closed nfraprado closed 4 years ago

nfraprado commented 4 years ago

After upgrading to python 3.8, tasklib stopped working. The following is the error that happens when following the usage example from the readme:

>>> from tasklib import TaskWarrior
>>> tw = TaskWarrior('/home/nfraprado/.task')
>>> tasks = tw.tasks.pending()
>>> tasks
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/tasklib/task.py", line 473, in __repr__
    data = list(self[:REPR_OUTPUT_SIZE + 1])
  File "/usr/lib/python3.8/site-packages/tasklib/task.py", line 490, in __getitem__
    self._result_cache = list(self)
  File "/usr/lib/python3.8/site-packages/tasklib/task.py", line 480, in __len__
    self._result_cache = list(self)
  File "/usr/lib/python3.8/site-packages/tasklib/task.py", line 480, in __len__
    self._result_cache = list(self)
  File "/usr/lib/python3.8/site-packages/tasklib/task.py", line 480, in __len__
    self._result_cache = list(self)
  [Previous line repeated 494 more times]
RecursionError: maximum recursion depth exceeded

I tried the exact same procedures with python 3.7.4 and everything worked as expected in that version.