Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colons in tags should be automatically escaped #129

Open
mpenning opened this issue Dec 28, 2023 · 0 comments
Open

Colons in tags should be automatically escaped #129

mpenning opened this issue Dec 28, 2023 · 0 comments

Comments

@mpenning
Copy link

mpenning commented Dec 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant