GothenburgBitFactory / GothenburgBitFactory/tasklib

Colons in tags should be automatically escaped

Open
#129 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
159
Forks
29
PR merge metrics
No merged PRs in 30d

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:

```python
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:
```none
{'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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.