Skip to content

Colons in tags should be automatically escaped #129

Open
@mpenning

Description

If you add a tag named 'completion:20', you get a bogus '20' key entry in Task()._data. If the aforementioned tag with a colon is added via tasklib, it should not create a '20' key in Task()._data.

Explicit example:

import tasklib

tw = tasklib.TaskWarrior()
task = tasklib.Task(tw, description="My new task", due="2023-12-28")
task['tags'] = ["completion:20"]
print(task._data)

This prints:

{'id': 1, '20': 'x', 'description': 'My new task', 'due': datetime.datetime(2023, 12, 28, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=64800), 'CST')), 'entry': datetime.datetime(2023, 12, 27, 15, 50, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=64800), 'CST')), 'modified': datetime.datetime(2023, 12, 27, 15, 50, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=64800), 'CST')), 'status': 'pending', 'uuid': '19fcabd2-636c-43a0-b324-83e622001943', 'tags': {'completion:20'}, 'urgency': 17.5446}

The '20' key above seems to be a colon escaping bug, unless this behavior is intentional.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions