No description
Find a file
Dennis Schridde 4af061abda on-modify.timewarrior: Deal with non-UTF-8 characters in input data from taskwarrior
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
2021-05-10 21:43:26 +02:00
test Add output of new-tag-warnings to check 2021-05-10 21:43:26 +02:00
on-modify.timewarrior on-modify.timewarrior: Deal with non-UTF-8 characters in input data from taskwarrior 2021-05-10 21:43:26 +02:00