[Bug 1835421] [NEW] EasyID3.RegisterTextKey(..., 'COMM') fails on retrieve

Simon Lambourn simon.lambourn at gmail.com
Thu Jul 4 14:23:58 UTC 2019


Public bug reported:

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)

** Affects: mutagen (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug disco

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to mutagen in Ubuntu.
https://bugs.launchpad.net/bugs/1835421

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

Status in mutagen package in Ubuntu:
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutagen/+bug/1835421/+subscriptions



More information about the foundations-bugs mailing list