1. Travis Shirk
  2. eyeD3
  3. Issues
Issue #125 resolved

eyeD3 on Debian Jessie, tag containing char ' leads to: UnicodeEncodeError: UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 3: ordinal not in range(256)

Lucas Bender
created an issue

Hello, i'm using Debian GNU/Linux Jessie (stable) amd64, python = 2.7.9-1. I have tested with both eyeD3 = 0.6.18-1 (stable) and eyeD3 = 0.7.10-1 (sid).

I'm converting my MP3 collection from ID3 v2.3 to v1.1 with the following command:

eyeD3 --to-v1.1 duke.mp3

And it gives me the following output:

/xxx/duke.mp3                               [ 10.35 MB ]
-------------------------------------------------------------------------------
Time: 04:30     MPEG1, Layer III        [ 320 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------------
ID3 v2.3:
title: Won't Look Back
artist: Duke Dumont
album: Won't Look Back
album artist: None
recording date: 2014
track: 1
disc: 1/1
FRONT_COVER Image: [Size: 24300 bytes] [Type: image/jpeg]
Description: Front Cover

Writing ID3 version v1.1
Uncaught exception: 'latin-1' codec can't encode character u'\u2019' in position 3: ordinal not in range(256)

eyed3:ERROR: 'latin-1' codec can't encode character u'\u2019' in position 3: ordinal not in range(256)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eyed3/main.py", line 281, in <module>
    retval = mainFunc(args, config)
  File "/usr/lib/python2.7/dist-packages/eyed3/main.py", line 49, in main
    fs_encoding=args.fs_encoding)
  File "/usr/lib/python2.7/dist-packages/eyed3/utils/__init__.py", line 75, in walk
    handler.handleFile(os.path.abspath(path))
  File "/usr/lib/python2.7/dist-packages/eyed3/plugins/classic.py", line 485, in handleFile
    max_padding=max_padding)
  File "/usr/lib/python2.7/dist-packages/eyed3/id3/tag.py", line 772, in save
    self._saveV1Tag(version)
  File "/usr/lib/python2.7/dist-packages/eyed3/id3/tag.py", line 797, in _saveV1Tag
    tag += pack(self.album.encode("latin_1") if self.album else b"", 30)
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 3: ordinal not in range(256)

Any ideas how to fix it?

Thanks!

Comments (3)

  1. Log in to comment