MP4 fails with string argument for freeform text ('----') tags
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mutagen |
New
|
Unknown
|
|||
mutagen (Ubuntu) |
New
|
Undecided
|
Unassigned |
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/
self.tags[key] = value
File "/usr/lib/
self.
File "/usr/lib/
return render_func(self, key, value, *render_args)
File "/usr/lib/
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
ProcVersionSign
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:
PackageArchitec
SourcePackage: mutagen
UpgradeStatus: Upgraded to disco on 2019-04-25 (74 days ago)
Changed in mutagen: | |
status: | Unknown → New |
PS. The use case for this is in storing and retrieving musicbrainz ID tags, which are stored as freeform tags.