Looking For mp3 ID Tag Module

Iñigo Serna inigoserna at gmail.com
Thu Aug 17 19:11:37 EDT 2006


On 8/18/06, Tim Daneliuk <tundra at tundraware.com> wrote:
> > try mutagen. http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen
>
> This module is more-or-less exactly what I needed.  However, I am running
> into problems when the filenames or ID tags have unicode characters in them.
>
> Typically, I do something like:
>
> from mutagen.easyid3 import EasyID3
>
> audio["title'] = Something based on the filename that has unicode chars in it
>
> I then get this:
>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 56: ordinal not in range(128)

>From the docs:
"""Mutagen has full Unicode support for all formats. When you assign
text strings, we strongly recommend using Python unicode objects
rather than str objects. If you use str objects, Mutagen will assume
they are in UTF-8."""

So I suppose the value you try to assign as title is not unicode,
check the encoding used in the file system.

Iñigo



More information about the Python-list mailing list