nicfit / eyeD3

eyeD3 is a Python module and command line program for processing ID3 tags. Information about mp3 files (i.e bit rate, sample frequency, play time, etc.) is also provided. The formats supported are ID3v1 (1.0/1.1) and ID3v2 (2.3/2.4).
http://eyed3.nicfit.net/
GNU General Public License v3.0
541 stars 58 forks source link

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

Open ghost opened 3 years ago

ghost commented 3 years ago

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.

nicfit commented 2 years ago

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.