1. Travis Shirk
  2. eyeD3
  3. Issues
Issue #40 resolved

eyeD3 should not abort on files with TSO2 frame

Denilson Sá
created an issue

I had many MP3 files tagged using MusicBrainz Picard 1.2. Then I tried this command:

eyeD3 --remove-all-images --add-image "${PICTURE}:${TYPE}" foobar.mp3

And it threw this error:

Writing ID3 version v2.3
Uncaught exception: Unable to covert the following frames to version v2.3: TSO2

eyed3:ERROR: Unable to covert the following frames to version v2.3: TSO2
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/eyed3/main.py", line 276, in <module>
    retval = mainFunc(args, config)
  File "/usr/lib64/python2.7/site-packages/eyed3/main.py", line 46, in main
  File "/usr/lib64/python2.7/site-packages/eyed3/utils/__init__.py", line 103, in walk
  File "/usr/lib64/python2.7/site-packages/eyed3/plugins/classic.py", line 445, in handleFile
  File "/usr/lib64/python2.7/site-packages/eyed3/id3/tag.py", line 742, in save
    self._saveV2Tag(version, encoding)
  File "/usr/lib64/python2.7/site-packages/eyed3/id3/tag.py", line 927, in _saveV2Tag
  File "/usr/lib64/python2.7/site-packages/eyed3/id3/tag.py", line 838, in _render
  File "/usr/lib64/python2.7/site-packages/eyed3/id3/tag.py", line 1071, in _convertFrames
TagException: Unable to covert the following frames to version v2.3: TSO2

Then I thought: Heck, I'm not even touching the TSO2 frame, eyeD3 should not try to mess with it, and it should not abort like that!

Here are all the tags from within that file:

$ mid3v2 --list-raw foobar.mp3 | fgrep -v APIC
Raw IDv2 tag info for foobar.mp3:
TMED(encoding=1, text=[u'CD'])
TXXX(encoding=1, desc=u'SCRIPT', text=[u'Latn'])
TXXX(encoding=1, desc=u'MusicBrainz Album Type', text=[u'album'])
TXXX(encoding=1, desc=u'MusicBrainz Album Artist Id', text=[u'aade363d-78b6-468b-b089-c73db57c36bc'])
TXXX(encoding=1, desc=u'MusicBrainz Artist Id', text=[u'14119a37-9755-4e27-9687-769b9f4f97d6'])
TXXX(encoding=1, desc=u'BARCODE', text=[u'7898176270050'])
TSO2(encoding=1, text=[u'Capacete, Jorge'])
TPE2(encoding=1, text=[u'Jorge Capacete'])
TPE1(encoding=1, text=[u'MP3'])
TXXX(encoding=1, desc=u'MusicBrainz Release Group Id', text=[u'2156861c-6e46-423b-a82b-c650b8bf4fbc'])
TORY(encoding=1, text=[u'1999'])
TCMP(encoding=1, text=[u'1'])
UFID(owner=u'http://musicbrainz.org', data='d216ba82-9082-4f6d-bd77-d4db7c045935')
TALB(encoding=1, text=[u'Excentric'])
TSOP(encoding=1, text=[u'Mp3'])
TRCK(encoding=0, text=[u'2/17'])
TIT2(encoding=1, text=[u'Vicious Mind'])
TCON(encoding=0, text=[u'Other'])
TYER(encoding=1, text=[u'1999'])
TXXX(encoding=1, desc=u'MusicBrainz Album Id', text=[u'08afb277-8d7b-47b8-9b52-4f79ab9600aa'])
TPOS(encoding=0, text=[u'1/1'])
TXXX(encoding=1, desc=u'MusicBrainz Album Release Country', text=[u'BR'])

If I add --remove-frame TSO2 to eyeD3 command-line, then it works "correctly", although it removes the TSO2 frame and converts TSOP to XSOP.

The file originally had id3v2.3 (I checked with an hex editor), so eyeD3 shouldn't have needed to perform any conversion from 2.3 to 2.3.

Suggestions for solutions:

  1. I'm not converting between id3 versions, eyeD3 should not attempt to convert in this case.
  2. Since I'm not converting, unknown frames should be left untouched.
  3. Since eyeD3 already supports TSOP, maybe it should also support TSO2.

Comments (5)

  1. Travis Shirk repo owner

    TSOP is not a valid frame per ID3 v2.3 (it was added in 2.4), so technically it is invalid in a 2.3 tag. 2.3 tags use XSOP instead, that is why the conversion is happening. It is making your 2.3 tag more 2.3'ish. If the tags was 2.4 or you were converting then TSOP would remain. A fix for supporting TS02 will follow.

  2. Log in to comment