[Bug 1835771] Re: MP4 fails with string argument for freeform text ('----') tags

Simon Lambourn simon.lambourn at gmail.com
Mon Jul 8 14:27:24 UTC 2019


PS. The use case for this is in storing and retrieving musicbrainz ID
tags, which are stored as freeform tags.

-- 
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/1835771

Title:
  MP4 fails with string argument for freeform text ('----') tags

Status in mutagen package in Ubuntu:
  New

Bug description:
  mutagen.mp4.MP4 container does not accept a string value for freeform
  text tags, but expects (and returns) a bytes argument.  This is
  inconsistent with python3 default of string values.

  code:
  >>> import mutagen.mp4.MP4 as MP4
  >>> m = MP4()
  >>> m['----:test:item'] = 'test value'
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3/dist-packages/mutagen/_file.py", line 75, in __setitem__
      self.tags[key] = value
    File "/usr/lib/python3/dist-packages/mutagen/mp4/__init__.py", line 375, in __setitem__
      self._render(key, value)
    File "/usr/lib/python3/dist-packages/mutagen/mp4/__init__.py", line 391, in _render
      return render_func(self, key, value, *render_args)
    File "/usr/lib/python3/dist-packages/mutagen/mp4/__init__.py", line 632, in __render_freeform
      data += v
  TypeError: can't concat str to bytes
  >>> m['----:test:item'] = b'test value'
  >>> m['----:test:item']
  b'test value'
  >>> 

  Expected behaviour:  accept (and return) string values, with encoding
  to utf-8 if required (this is implied in some of the comments in the
  code).

  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: Mon Jul  8 15:03:10 2019
  Dependencies:
   
  PackageArchitecture: all
  SourcePackage: mutagen
  UpgradeStatus: Upgraded to disco on 2019-04-25 (74 days ago)

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



More information about the foundations-bugs mailing list