Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: tuple index out of range #211

Closed
lazka opened this issue Feb 5, 2015 · 4 comments
Closed

IndexError: tuple index out of range #211

lazka opened this issue Feb 5, 2015 · 4 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Feb 5, 2015

Originally reported by: dbarn (Bitbucket: dbarn, GitHub: dbarn)


I am running mutagen 1.27. I get an uncaught IndexError when attempting to load a couple mp3 files that were downloaded from a podcast.

This is the line that causes the error:

audio = mutagen.File( filePath, easy=True )

Here is the traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/mutagen/_file.py", line 235, in File
    return Kind(filename)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/_file.py", line 40, in __init__
    self.load(filename, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/__init__.py", line 1020, in load
    self.tags = ID3(filename, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/easyid3.py", line 173, in __init__
    self.load(filename)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/__init__.py", line 164, in load
    for frame in self.__read_frames(data, frames=frames):
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/__init__.py", line 383, in __read_frames
    yield self.__load_framedata(tag, 0, framedata)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/__init__.py", line 390, in __load_framedata
    return tag.fromData(self, flags, framedata)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/_frames.py", line 201, in fromData
    frame._readData(data)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/_frames.py", line 128, in _readData
    value, data = reader.read(self, data)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/_specs.py", line 227, in read
    value, data = spec.read(frame, data)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/id3/_specs.py", line 193, in read
    enc, term = self._encodings[frame.encoding]
IndexError: tuple index out of range

I have attached one of the files that yields the error.


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Feb 6, 2015

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


Thanks

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Feb 6, 2015

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


id3: don't leak IndexError on invalid encoding fields. (Fixes issue #211)

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Feb 6, 2015

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


mutagen will now load the file but will throw out all the tag data as it's completely broken (A mix of id3v2.4 and 2.2 frames in a supposedly 2.2 tag)

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Feb 9, 2015

Original comment by dbarn (Bitbucket: dbarn, GitHub: dbarn):


That was fast! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.