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

Cannot pprint or save AIFF after changing an ID3 tag #251

Closed
lazka opened this issue Dec 18, 2015 · 4 comments
Closed

Cannot pprint or save AIFF after changing an ID3 tag #251

lazka opened this issue Dec 18, 2015 · 4 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Dec 18, 2015

Originally reported by: Gabriel Valiente (Bitbucket: valiente, GitHub: valiente)


#!python

>>> from mutagen import File
>>> audio = File(filename.aiff)
>>> audio.delete()
>>> audio["title"] = "My title"
>>> audio
{'title': 'My title'}
>>> audio.pprint()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/mutagen/_file.py", line 137, in pprint
    tags = self.tags.pprint()
  File "/Library/Python/2.7/site-packages/mutagen/id3/__init__.py", line 340, in pprint
    frames = sorted(Frame.pprint(s) for s in self.values())
  File "/Library/Python/2.7/site-packages/mutagen/id3/__init__.py", line 340, in <genexpr>
    frames = sorted(Frame.pprint(s) for s in self.values())
TypeError: unbound method pprint() must be called with Frame instance as first argument (got str instance instead)
>>> audio.save()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/mutagen/_file.py", line 130, in save
    return self.tags.save(filename, **kwargs)
  File "/Library/Python/2.7/site-packages/mutagen/aiff.py", line 288, in save
    v23_sep, padding)
  File "/Library/Python/2.7/site-packages/mutagen/id3/__init__.py", line 465, in _prepare_data
    for (key, frame) in frames]
  File "/Library/Python/2.7/site-packages/mutagen/id3/__init__.py", line 600, in __save_frame
    framedata = frame._writeData()
AttributeError: 'str' object has no attribute '_writeData'

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Dec 18, 2015

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


Thanks

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Dec 18, 2015

Original comment by Gabriel Valiente (Bitbucket: valiente, GitHub: valiente):


Thanks to you

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jan 18, 2016

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


id3: do type checking in setitem. See #251

Make sure setting non-Frame values fails

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jan 18, 2016

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


AIFF only allows setting ID3 frames though the add() method. I've added a check to make it clearer in fc98f3270dee702.

@lazka lazka added major bug labels Apr 7, 2016
@lazka lazka closed this Apr 7, 2016
lazka added a commit that referenced this issue Apr 7, 2016
Make sure setting non-Frame values fails
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.