mirror of
https://github.com/GothenburgBitFactory/task-timewarrior-hook.git
synced 2025-06-26 10:54:27 +02:00
No description
![]() When input data from taskwarrior (e.g. via bugwarrior) contains UTF-8-illegal characters, `on-modify.timewarrior` would fail: ``` Traceback (most recent call last): File "$HOME/.task/hooks/on-modify.timewarrior", line 42, in <module> old = json.loads(sys.stdin.readline()) File "/usr/lib/python3.6/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 1042: invalid continuation byte ``` This is fixed by manually decoding from stdin's underlying binary I/O object and replacing encoding errors with the Unicode replacement character [1]. [1]: https://docs.python.org/3/library/codecs.html#error-handlers |
||
---|---|---|
test | ||
on-modify.timewarrior |