ralphbean / taskw

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

Fetching a (periodic) task fails - Unable to find report that matches #153

Closed bergercookie closed 2 years ago

bergercookie commented 2 years ago

I'm trying to fetch the contents of the following task:

ID              463
Description     Glass of lemon
Status          Pending
Recurrence      daily
Parent task     f2a34eee-9239-4d4a-9fc4-c3574abc9903
Mask Index      240
Recurrence type periodic
Entered         2021-11-29 08:22:46 (1d)
Due             2021-11-30 02:45:00
Last modified   2021-11-30 09:10:17 (12h)
Tags            remindme routine
Virtual tags    CHILD DUE DUETODAY INSTANCE MONTH OVERDUE PENDING QUARTER READY TAGGED TODAY UNBLOCKED WEEK YEAR
UUID            5fac74b4-dce7-4f4c-aa58-ce1f445269db
Urgency         5.071

    tags           0.9 *    1 =    0.9
    due          0.764 *   12 =   9.17
    age          0.003 *    2 =  0.005
    TAG routine      1 *   -5 =     -5
                                ------
                                 5.071

Date                Modification
2021-11-30 09:10:17 Due changed from '2021-11-30 02:45:03' to '2021-11-30 02:45:00'.

Doing so from taskw fails:

tw.get_task(uuid=UUID('5fac74b4-dce7-4f4c-aa58-ce1f445269db'))

~/.local/lib/python3.8/site-packages/taskw/warrior.py in _execute(self, *args)
    475
    476         if proc.returncode != 0:
--> 477             raise TaskwarriorError(command, stderr, stdout, proc.returncode)
    478
    479         # We should get bytes from the outside world.  Turn those into unicode

<class 'str'>: (<class 'TypeError'>, TypeError('__str__ returned non-string (type bytes)'))

it fails because it eventually tries to run the following command:

task rc.json.array=TRUE rc.verbose=nothing rc.confirmation=no rc.dependency.confirmation=no rc.recurrence.
confirmation=no  export 5fac74b4-dce7-4f4c-aa58-ce1f445269db

which fails with

Unable to find report that matches '5fac74b4-dce7-4f4c-aa58-ce1f445269db'.

If the UUID on the other hand is put right after task then it actually exports the contents of the task as expected.


Not sure if this is an issue with taskw or taskwarrior itself. Any pointers how can I solve it? Why e.g. is taskw not assembling the get-task command with the task UUID always as the second argument?

Thanks

bergercookie commented 2 years ago

Probably this was because I was using taskw 1.3.0 and not 1.3.1. Reading from the changelog of the said version:

@tbabej: #152; Adds support for Taskwarrior 2.6.0

Repeating the corresponding query from python now works!