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
536 stars 58 forks source link

How to catch a GenreException? #519

Open cyberdynesoftware opened 3 years ago

cyberdynesoftware commented 3 years ago

I'm getting this output from eyeD3:

Invalid numeric genre ID: 255
Unknown genre ID: 255

And I found that there is a eyed3.id3.GenreException. Tried to catch that with:

try:
    song = eyed3.load(entry)
except eyed3.id3.GenreException:
    print('foo')

I expected to see foo instead of above output, but it's still the same.

Is the GenreException even thrown? Or is it just normal print() output?

Btw, there is a google group mentioned on the project page, eyeD3-users. I joined, but apperently I "don't have permission to post in this group".

nicfit commented 3 years ago

https://github.com/nicfit/eyeD3/blob/3debffa3d848a4473e52329a4386c11d26f11195/eyed3/id3/__init__.py#L134

Looks like it is a ValueError you could catch in that code flow.