quodlibet / mutagen

Python module for handling audio metadata

Home Page:https://mutagen.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unpack requires a buffer of 8 bytes

alucryd opened this issue · comments

Hi guys, trying to import my library into beets, I'm getting a lot of 'unreadable' m4a files, even though they're perfectly fine. Trying mutagen-inspect on them returns the error in the title. I'm using version 1.45.1 on Arch Linux with Python 3.10. Is that maybe a problem running on Python 3.10? Happy to provide more details or one of the files for testing.

I've just added Python 3.10 testing to CI and everything seems to work fine.

You can send me a file to reiter.christoph@gmail.com (or post it publicly if there are not copyright issues)

Thanks, the first file (1.01) fails with:

Traceback (most recent call last):
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 1203, in load
    self.chapters = self.MP4Chapters(atoms, fileobj)
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 923, in __init__
    self.load(*args, **kwargs)
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 947, in load
    self._parse_chpl(chpl, fileobj)
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 991, in _parse_chpl
    start = struct.unpack(">Q", data[pos:pos + 8])[0] / 10000
struct.error: unpack requires a buffer of 8 bytes

It's a mutagen bug that this error is handled properly, but needs investigating if the file is broken or not.

The second file (1.03) works fine for me (also using Python 3.10).

FWIW the files play fine, and they were all originally managed by beets (both working and non working files). I can try to retag them with another software, see if that helps.