Package: python-eyed3
Version: 0.6.14-1
Severity: normal

Hello,

when I try to update a tag with non-ascii charachters in the comment
field I get an UnicodeEncodeError (traceback below). I think, the reason
is a missing `encode' call in the Tag.__saveV1Tag method. All other
fields are encoded using 'latin-1' but comment is not encoded.

Example Traceback:
  File "/home/eike/python/audiofile.py", line 302, in writeFile
    if not tag.update(eyeD3.ID3_V1_1):
  File "/var/lib/python-support/python2.5/eyeD3/tag.py", line 520, in update
    self.__saveV1Tag(version);
  File "/var/lib/python-support/python2.5/eyeD3/tag.py", line 1064, in 
__saveV1Tag
    cmt = self._fixToWidth(cmt, 30);
  File "/var/lib/python-support/python2.5/eyeD3/tag.py", line 1096, in 
_fixToWidth
    retval = str(s);
UnicodeEncodeError: 'ascii' codec can't encode characters in position 56-59: 
ordinal not in range(128)

I added the missing encode call in file tag.py and it worked for me.
Patch is attached.

Regards
    eike

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (102, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-eyed3 depends on:
ii  python                        2.4.4-6    An interactive high-level object-o
ii  python-support                0.7.6      automated rebuilding support for p

python-eyed3 recommends no packages.

-- no debconf information
--- tag.py-orig 2007-05-08 04:17:44.000000000 +0200
+++ tag.py      2008-02-17 23:22:42.000000000 +0100
@@ -1061,7 +1061,7 @@
          elif c.description == "":
             cmt = c.comment;
             # Keep searching in case we find the description eyeD3 uses.
-      cmt = self._fixToWidth(cmt, 30);
+      cmt = self._fixToWidth(cmt.encode("latin_1"), 30);
       if version != ID3_V1_0:
          track = self.getTrackNum()[0];
          if track != None:

Reply via email to