release-engineering/kobo

Crash in shortcuts.run when unicode character falls on chunk boundary

lubomir opened this issue · 1 comments

run reads output in chunks. If a unicode character happens to be split between two chunks, decoding fails and there is a crash.

This bug triggered a failure in Fedora 31 updates-testing compose: https://pagure.io/releng/failed-composes/issue/237

An easy workaround is to run the command with universal_newlines=True. This will decode the output at Python stdlib level, and the wrapper will see unicode. It would not work if the command does not use UTF-8, but in such case the decoding in shortcuts.run would not work either.