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

Problem adding ID3 tags to tagless file opened with MP3(filename, ID3=EasyID3) #89

lazka opened this issue Jul 4, 2014 · 1 comment


Copy link

@lazka lazka commented Jul 4, 2014

Originally reported by: Christoph Reiter (Bitbucket: lazka, GitHub: lazka)

From on May 16, 2011 02:39:08

I transcoded "tagged.mp3" with ID3 tags using lame, which throws away the tags, creating "untagged.mp3".  Opened both tagged and untagged files with MP3(filename, ID3=EasyID3).  Copied tags from tagged to untagged.  Now both untagged.pprint() and throw errors.  Slightly edited transcript:

$ ls
$ lame -b 192 tagged.mp3 untagged.mp3
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
LAME 3.97 32bits ( )
[feedback while transcoding]
Writing LAME Tag...done
ReplayGain: -5.6dB
$ python
Python 2.6.6 ( r266 :84292, May 13 2011, 10:40:57) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mutagen.mp3
>>> import mutagen.easyid3
>>> tagged = mutagen.mp3.MP3("tagged.mp3", ID3=mutagen.easyid3.EasyID3)
>>> print tagged.pprint()
MPEG 1 layer 3, 320000 bps, 44100 Hz, 247.77 seconds (audio/mp3)
album=The Burst of the West
artist=Harry Potter
performer=Harry Potter
title=You Said it Butch
>>> untagged = mutagen.mp3.MP3("untagged.mp3", ID3=mutagen.easyid3.EasyID3)
>>> print untagged.pprint()
MPEG 1 layer 3, 192000 bps, 44100 Hz, 248.25 seconds (audio/mp3)
>>> for k in tagged:
...     untagged[k] = tagged[k]
>>> print untagged.pprint()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mutagen/", line 140, in pprint
    try: tags = self.tags.pprint()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mutagen/", line 187, in pprint
    return "\n".join(map(Frame.pprint, self.values()))
TypeError: unbound method pprint() must be called with Frame instance as first argument (got list instance instead)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mutagen/", line 134, in save
    return, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mutagen/", line 365, in save
    framedata = [self.__save_frame(frame) for (key, frame) in frames]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mutagen/", line 443, in __save_frame
    framedata = frame._writeData()
AttributeError: 'list' object has no attribute '_writeData'
>>> tagged
{'album': [u'The Burst of the West'], 'performer': [u'Harry Potter'], 'title': [u'You Said it Butch'], 'artist': [u'Harry Potter'], 'encodedby': [u'Fission'], 'tracknumber': [u'2/3']}
>>> untagged
{'album': [u'The Burst of the West'], 'performer': [u'Harry Potter'], 'artist': [u'Harry Potter'], 'title': [u'You Said it Butch'], 'encodedby': [u'Fission'], 'tracknumber': [u'2/3']}

These errors don't occur, and I can correctly pprint and save the modified "untagged.mp3" if I open it either of these ways:
    untagged = mutagen.mp3.EasyMP3("untagged.mp3")
    untagged = mutagen.File("untagged.mp3", easy=True)

I can't tell whether the errors represent a bug or "expected" behavior.  Both the errors and successes occur with the 32K truncated examples attached.

Zoom H2 recorder software v1.2 320Kbps stereo ==> Fission 1.6.10 lossless editing ==> lame 3.97 transcoding to 192kbps ==> mutagen 1.20 under Python 2.6.6 on MacOS 10.6.7 ==> FTWIW !!!1!

Attachment: tagged32K.mp3 untagged32K.mp3

Original issue:


This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

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

From on May 16, 2011 02:50:06

This issue was closed by revision r107 .

Status: Fixed

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