eyeD3 icon indicating copy to clipboard operation
eyeD3 copied to clipboard

core.load() should raise an exception for unsupported files

Open ghost opened this issue 3 years ago • 1 comments

OS: macos 11.2.3 eyeD3 version: 0.9.7b0

If I have an incompatible file and do the following:

import eyed3
audiofile = eyed3.load("img.png")
audiofile.tag.artist = "abc"
audiofile.tag.save()

The result is:

Traceback (most recent call last):
  File "", line 3, in <module>
    audiofile.tag.artist = "abc"
AttributeError: 'NoneType' object has no attribute 'tag'

I guess it would be better if core.load() would not just return None but raise an exception.

Moreover, if I run eyeD3 with the unsupported file as an argument, I get: No audio files found. It would be better if eyeD3 noticed the user that the file type is unsupported.

ghost avatar Apr 18 '21 15:04 ghost

I never considered an mp3 without tag an error, so not exception worthy. The AudioFile object still has useful info about the mp3 itself in the result.

nicfit avatar Apr 03 '22 16:04 nicfit