Commits

Marcin Kasperski committed 37d7066

Fixed two more "UnicodeEncodeError" bugs appearing in some cases
(reported for books without files and with unicode character in names)

marked 1.2.3 version

Comments (0)

Files changed (2)

 
 from setuptools import setup, find_packages
 
-VERSION = '1.2.2'
+VERSION = '1.2.3'
 DESCRIPTION = "Calibre helper scripts (ISBN guessing, RTF to DOC conversion," \
     + "hanging books detection, ...)."
 LONG_DESCRIPTION = open("README.txt").read()

src/mekk/calibre/calibre_util.py

         except AttributeError:
             print >> sys.stderr, \
                 "Warning: book %s (%s) has no file associated." % (
-                elem.id.text, elem.title.text)
+                elem.id.text, elem.title.text.encode("utf-8"))
 
 
 FileItem = namedtuple('FileItem', 'id uuid title isbn files authors series series_idx')
                      for fmtel in elem.formats.iterchildren("format")]
         except AttributeError:
             files = []
-            print "Warning: book %s (%s) has no file associated." % (
-                elem.id.text, elem.title.text)
+            print >> sys.stderr, \
+                    "Warning: book %s (%s) has no file associated." % (
+                    elem.id.text, elem.title.text.encode("utf-8"))
         try:
             authors = [fmtel.text
                        for fmtel in elem.authors.iterchildren("author")]
         except AttributeError:
             authors = []
-            print "Warning: book %s (%s) has no author associated." % (
-                elem.id.text, elem.title.text)
+            print >> sys.stderr, \
+                    "Warning: book %s (%s) has no author associated." % (
+                    elem.id.text, elem.title.text.encode("utf-8"))
         if hasattr(elem, "series"):
             series = elem.series.text
             series_idx = elem.series.attrib["index"]