I met this error when it was unpacking the boot.img, only if I set LC_ALL=C before execute this command or comment the code setup_locale() it works. Is there any ...
Now I do not have Python 3 to test.... but from what I read, repr is a string (not bytes) and Exception must use a string too (not sure about that one). So from my understanding, we need bytes on PY2 ...