ralphbean / taskw

python taskwarrior api
http://threebean.org
GNU General Public License v3.0
176 stars 47 forks source link

`task_add` raises an error, but creates the task #146

Closed manoelpqueiroz closed 3 years ago

manoelpqueiroz commented 3 years ago

When trying to create a new task through taskw, an error is raised:

>>> from taskw import TaskWarrior
>>> w = TaskWarrior()
>>> w.task_add('test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myuser/.local/lib/python3.9/site-packages/taskw/warrior.py", line 697, in task_add
    task['uuid'] = re.search(UUID_REGEX, stdout).group(0)
AttributeError: 'NoneType' object has no attribute 'group'

It's not a breaking bug, though, the task is created just fine:

$ task list

ID Age Description Urg
 1 5s  test          0

The error is raised within the TaskWarriorShellout class, where stdout coming from TaskWarriorShellout._execute('add', *args) returns empty.

While the error seems to be a minor nuisance for the user when observed in isolation, this becomes a problem when paired with other packages that are built on top of taskw, like bugwarrior, because the worker stops after meeting the error and thus bugwarrior only pulls a single issue at a time.


I think this is a specific issue with either Python's or the dependecies' versions, as I ran taskw with errors in both Arch Linux and Manjaro, but Linux Mint worked without problems:

Package Arch-based Linux Mint
Python 3.9.2 3.8.5
six 1.15.0 1.14.0
python-dateutil 2.8.1 2.7.3
pytz 2021.1 2019.3
kitchen 1.2.6 1.2.6

If there is anything I can contribute with a pull request, please let me know.

BlackYoup commented 3 years ago

I believe this is the same issue as https://github.com/ralphbean/taskw/issues/144

manoelpqueiroz commented 3 years ago

Oh, silly me, I should've looked up before. Sorry.