GothenburgBitFactory / GothenburgBitFactory/task-timewarrior-hook

Hook breaks non-ascii tags

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I have a task with cyrillics in tags:

```
task add +рабочее "Тестовая задача"
```

After that I start it:

```
task 1 start
```

And hook replaces `+рабочее` to `\u0440\u0430\u0431\u043e\u0447\u0435\u0435`:

```
2025-01-17 19:40:40 Tag 'рабочее' deleted.
Tag '\u0440\u0430\u0431\u043e\u0447\u0435\u0435' added.
Start set to '2025-01-17 19:40:40'.
```

It is due to [json.dumps](https://github.com/GothenburgBitFactory/task-timewarrior-hook/blob/5380afae4314e34737a086e9eeccce0d34d736f6/on_modify.py#L109) is missing parameter `ensure_ascii = False`. From [docs](https://docs.python.org/3/library/json.html#json.dump):

> ensure_ascii ([bool](https://docs.python.org/3/library/functions.html#bool)) – If True (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If False, these characters will be outputted as-is.

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.