Issue #6 resolved

ValueError in Frames

Anonymous created an issue

In http://eyed3.nicfit.net/api/eyed3.id3.html#eyed3.id3.frames.UniqueFileIDFrame.parse I get a "ValueError: need more than 1 value to unpack"

Here's a trace:

Uncaught exception: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eyed3/main.py", line 251, in <module>
    retval = mainFunc(args, config)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/main.py", line 42, in main
    fs_encoding=args.fs_encoding)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/utils/__init__.py", line 86, in walk
    handler.handleFile(os.path.abspath(path))
  File "/usr/local/lib/python2.7/dist-packages/eyed3/plugins/classic.py", line 357, in handleFile
    super(ClassicPlugin, self).handleFile(f, tag_version=parse_version)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/plugins/__init__.py", line 156, in handleFile
    self.audio_file = core.load(f, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/core.py", line 61, in load
    return mp3.Mp3AudioFile(path, tag_version)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/mp3/__init__.py", line 150, in __init__
    core.AudioFile.__init__(self, path)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/core.py", line 192, in __init__
    self._read()
  File "/usr/local/lib/python2.7/dist-packages/eyed3/mp3/__init__.py", line 156, in _read
    tag_found = self._tag.parse(file_obj, self._tag_version)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/id3/tag.py", line 86, in parse
    tag_found, padding = self._loadV2Tag(fileobj)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/id3/tag.py", line 115, in _loadV2Tag
    self.extended_header)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/id3/frames.py", line 1044, in parse
    frame = createFrame(tag_header, frame_header, data)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/id3/frames.py", line 1135, in createFrame
    frame.parse(data, frame_header)
  File "/usr/local/lib/python2.7/dist-packages/eyed3/id3/frames.py", line 848, in parse
    (self.owner_id, self.uniq_id) = self.data.split("\x00", 1)
ValueError: need more than 1 value to unpack

This happens with newer MP3/id3v2.4 tags that come with newer files from Beatport.com

Comments (6)

  1. Travis Shirk repo owner

    I can reproduce, and found another problem with their tags also. The URL frames have an encoding byte that should not be there (only WXXX frames have that for the description). Two bug reports filed at support@beatport.com... anyway, I have a patch for the UFID that prevents a crash, but it is not ideal. The data for the UFID in my sample is:

    '\x03track-3140993'

    The correct data format is: <owner-id>\x00<ufid> Assuming they mean \x03 to be the owner ID (it can be binary) the null byte is missing. TBH, I think \x03 is an encoding byte which is not part of this data spec at all. The patch I'll likely commit avoids the unpack crash but ends up using a dummy owner ID with a unique file ID matching '\x03track-3140993'. Which is pretty bogus but I think it is all the we can do.

    The URL frame problem does not cause a crash, rather just a bogus (and invalid) URL such as, \x03http://example.com/...

  2. Log in to comment