Receiving ValueError when saving some files

When trying to save an album, some files are not getting saved. And I see the following error in the log.

I’ve traced the error to the calculated offset being 1 byte larger that the measured filesize

Note this happens to just some files within an album. I am on MacOS and saving to a NTFS external disk.

That seems to be basically the same issue as reported for mutagen (the tag reading component Picard uses) at

That issue is about WAVE files, but AIFF and WAVE files share the same basic structure and they share some code in mutagen.

In my (phw on Github) comments there I mention that probably mutagen should just fail more cleanly. That would be the easiest solution, but would not change much for your situation with Picard. The files are in a way broken and loading would fail.

But maybe we could detect cases like this, where the internal structure and the sizes noted there are fine but the file is missing some bytes at the end, simply assume the missing bytes as null bytes and add them. I haven’t looked into this in detail yet, though.


Thanks for your response, since I figured out how to run from source and can now debug the problem I will see if can work up a solution. I need to see if the issue is always just the size of the offset being one byte larger than the filesize.

1 Like

I’ve created an AIFF validation script that can be found here

Using phw’s reference for RIFF files

1 Like