EasyID3.RegisterTextKey(...,'COMM') fails on retrieve

Bug #1835421 reported by Simon Lambourn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mutagen (Ubuntu)
New
Undecided
Unassigned

Bug Description

EasyID3.RegisterTextKey('comment', 'COMM') actually defines a frame called 'COMM::XXX', which can't be retrieved by the same name.

You can set this field as follows

>>> e = EasyID3()
>>> e['comment'] = 'a comment'
>>> vars(e)
{'_EasyID3__id3': {'COMM::XXX': COMM(encoding=<Encoding.UTF8: 3>, lang='XXX', desc='', text=['a comment'])}}

but attempting to retrieve it causes a KeyErrror:'COMM'

Code:
>>> e['comment']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/mutagen/easyid3.py", line 213, in __getitem__
    return func(self.__id3, key)
  File "/usr/lib/python3/dist-packages/mutagen/easyid3.py", line 121, in getter
    return list(id3[frameid])
  File "/usr/lib/python3/dist-packages/mutagen/_util.py", line 536, in __getitem__
    return self.__dict[key]
KeyError: 'COMM'

As a workaround, if I define a second text key
>>> EasyID3.RegisterTextKey('comment2', 'COMM::XXX')
I can now retrieve the original tag

>>> vars(e)
{'_EasyID3__id3': {'COMM::XXX': COMM(encoding=<Encoding.UTF8: 3>, lang='XXX', desc='', text=['a comment'])}}
>>> e['comment2']
['a comment']

Expected behaviour: e['comment'] returns 'a comment'

ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: python3-mutagen 1.40.0-2
ProcVersionSignature: Ubuntu 5.0.0-20.21-generic 5.0.8
Uname: Linux 5.0.0-20-generic x86_64
ApportVersion: 2.20.10-0ubuntu27
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Jul 4 15:13:27 2019
Dependencies:

PackageArchitecture: all
SourcePackage: mutagen
UpgradeStatus: Upgraded to disco on 2019-04-25 (70 days ago)

Revision history for this message
Simon Lambourn (simon-lambourn-o) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.