Taskwarrior: Usage of double backslash in description results in pending.json corruption

Created on 18 Sep 2018  路  3Comments  路  Source: GothenburgBitFactory/taskwarrior

What command(s) did you run?

task 123 mod wait:tom -- Datei verschieben nach Z:\\

This is reproducible.
I have _not_ tested weather or not the modification of the wait is important and/or if this happens at task creation too.

What did you expect to happen?

Title is changed to "Datei verschieben nach Z:\"

My intention of \ was to avoid bash going into multi-line mode.

What actually happened?

Task 123 was modified but written incompletely to disk.

[description:"Datei verschieben nach Z:\\

Calling TW again resulted in error

task: /build/task-9MXxZv/task-2.5.1+dfsg/src/Task.cpp:1955: float Task::urgency_age() const: Assertion `has ("entry")' failed.
core dumped

Fix

open the json file and fix the broken json.

Paste the output of the task diag command.

Ubuntu 14.04 inside Windows Subsystem for Linux.

task 2.5.1
   Platform: Linux

Compiler
    Version: 5.4.0 20160609
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++11

Build Features
      CMake: 3.5.1
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.4.10
 Build type: None

Configuration
       File: /home/REDACTED/.taskrc (found), 608 bytes, mode 100666
       Data: /mnt/c/Users/REDACTED/.task (found), dir, mode 40777
    Locking: Enabled
         GC: Enabled
     Server:
      Trust: strict
Certificate: , not readable, 0 bytes
        Key: , not readable, 0 bytes
    Ciphers: NORMAL
      Creds:

Hooks
     System: Enabled
   Location: /mnt/c/Users/REDACTED/.task/hooks
             (-none-)

Tests
      $TERM: xterm-256color (170x36)
       Dups: Scanned REDACTED tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned REDACTED tasks for broken references:
             No broken references found

Ref

possibly related to https://github.com/GothenburgBitFactory/taskwarrior/issues/2018, https://github.com/GothenburgBitFactory/taskwarrior/issues/1960 and/or https://github.com/GothenburgBitFactory/taskwarrior/issues/2049. I'm no tw dev.

bug

All 3 comments

Good catch.

It seems this line tries to escape the backslash and results the description has a \0 character. ...so a possible workaround is task 123 mod wait:tom -- Datei verschieben nach Z:\\\\

tbh I use the edit for most of my heavy lifting.
I'm still not sure where to put multi-line descriptions (e. g. pasted E-Mails)
IIRC TW does not support the sort of rich description which would be required for this

Was this page helpful?
0 / 5 - 0 ratings