whipper icon indicating copy to clipboard operation
whipper copied to clipboard

UnicodeDecodeError at <frozen codecs>:325: decode(): 'utf-8' codec can't decode byte 0x89 in posi tion 119: invalid start byte

Open olafhering opened this issue 3 months ago β€’ 5 comments

This happens with 0.10.0, while reading damaged CD#3.

With Python 3.6 on openSUSE Leap 15.3 the process of extracting gets past the point of the "release selection", and starts to very slowly extract the readable tracks.

With Python 3.13 on openSUSE Tumbleweed the code fails to handle obtained data, like this:

+ whipper -e success cd rip --prompt --max-retries 2 --output-directory ~/Music/ --keep-going
INFO:whipper.command.cd:using configured read offset 6
INFO:whipper.command.cd:checking device /dev/sr0
Reading TOC   0 %^MReading TOC   7 %^MReading TOC  15 %^MReading TOC  23 %^MReading TOC  30 %^MReading TOC  38 %^MReading TOC  46 %^MReading TOC  53 %^MReading TOC  61 %^MReading TOC  69 %^MReading TOC  76 %^MReading TOC  84 %^MReading TOC  92 %^MReading TOC 100 %^M                 ^MReading TOC 100 %^MTraceback (most recent call last):
Traceback (most recent call last):
  File "/usr/lib64/python3.13/site-packages/whipper/extern/task/task.py", line 523, in c
    callable_task(*args, **kwargs)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 115, in _read
    self._done()
    ~~~~~~~~~~^^
  File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 153, in _done
    self.toc.parse()
    ~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/site-packages/whipper/image/toc.py", line 203, in parse
    content = f.readlines()
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 119: invalid start byte
CRITICAL:whipper.command.main:exception UnicodeDecodeError at <frozen codecs>:325: decode(): 'utf-8' codec can't decode byte 0x89 in posi
tion 119: invalid start byte
Traceback (most recent call last):
  File "/usr/lib64/python3.13/site-packages/whipper/extern/task/task.py", line 523, in c
    callable_task(*args, **kwargs)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 115, in _read
    self._done()
    ~~~~~~~~~~^^
  File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 153, in _done
    self.toc.parse()
    ~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/site-packages/whipper/image/toc.py", line 203, in parse
    content = f.readlines()
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 119: invalid start byte

olafhering avatar Sep 15 '25 06:09 olafhering

πŸ‘‹ Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

github-actions[bot] avatar Sep 15 '25 06:09 github-actions[bot]

I'm seeing a similar error on Tumbleweed with Python 3.13:

  File "/usr/lib64/python3.13/site-packages/whipper/image/toc.py", line 203, in parse
    content = f.readlines()
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 126: invalid start byte

But my guess was that it got something to do with the CDTEXT in the toc since the artist has an ΓΆ in its name. But I may be wrong. But attaching the .toc (created with cdrdao read-toc --fast-toc --device /dev/sr0) nevertheless if someone wants to doublecheck.

till_broenner_the_verve_years.toc.txt

fiete201 avatar Sep 23 '25 05:09 fiete201

I get the same error with three different CDs, I am also on tumbleweed and python 3.13

./whipper_KON.sh INFO:whipper.command.cd:using configured read offset 6 INFO:whipper.command.cd:checking device /dev/sr0 WARNING:whipper.program.utils:command 'eject -t /dev/sr0' returned with exit code '1' (b'eject: CD-ROM-Befehl zum Schlie\xc3\x9fen der Lade fehlgeschlagen: Datei oder Verzeichnis nicht gefunden') Traceback (most recent call last): File "/usr/lib64/python3.13/site-packages/whipper/extern/task/task.py", line 523, in c callable_task(*args, **kwargs) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 115, in _read self._done() ~~~~~~~~~~^^ File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 153, in _done self.toc.parse() ~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.13/site-packages/whipper/image/toc.py", line 203, in parse content = f.readlines() File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 106: invalid start byte CRITICAL:whipper.command.main:exception UnicodeDecodeError at :325: decode(): 'utf-8' codec can't decode byte 0x89 in position 106: invalid start byte Traceback (most recent call last): File "/usr/lib64/python3.13/site-packages/whipper/extern/task/task.py", line 523, in c callable_task(*args, **kwargs) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 115, in _read self._done() ~~~~~~~~~~^^ File "/usr/lib64/python3.13/site-packages/whipper/program/cdrdao.py", line 153, in _done self.toc.parse() ~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.13/site-packages/whipper/image/toc.py", line 203, in parse content = f.readlines() File "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 106: invalid start byte

qsecofr avatar Sep 28 '25 13:09 qsecofr

I ran into this issue myself. It is not a whipper bug, but a bug in the current version of cdrdao. Getting the source code for cdrdao-1.2.4 and compiling it fixed the issue entirely for me.

C600K3D avatar Nov 08 '25 14:11 C600K3D

While it's still arguably a cdrdao bug, it can be worked around by adding '--datafile', 'disc.bin' to the cdrdao argument list in ReadTOCTask in cdrdao.py. That will make the FILE lines in the TOC reference the (nonexistent) disc.bin instead of whatever (broken?) cdrdao builds put there.

WillEwing avatar Nov 24 '25 09:11 WillEwing