From 6634b010f8688efbd09ecb314175f2209f3bb0d5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Nov 2013 19:01:16 +0530 Subject: [PATCH] Use unicode instead of str when typecasting --- src/calibre/devices/kobo/books.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/kobo/books.py b/src/calibre/devices/kobo/books.py index 8fd82ce4f1..d05b09236f 100644 --- a/src/calibre/devices/kobo/books.py +++ b/src/calibre/devices/kobo/books.py @@ -162,7 +162,7 @@ class KTCollectionsBookList(CollectionsBookList): elif fm is not None and fm['datatype'] == 'series': val = [orig_val] elif fm is not None and fm['datatype'] == 'rating': - val = [str(orig_val / 2)] + val = [type(u'')(orig_val / 2.0)] elif fm is not None and fm['datatype'] == 'text' and fm['is_multiple']: if isinstance(orig_val, (list, tuple)): val = orig_val @@ -207,7 +207,7 @@ class KTCollectionsBookList(CollectionsBookList): if not category: continue - cat_name = str(category).strip(' ,') + cat_name = type(u'')(category).strip(' ,') if cat_name not in collections: collections[cat_name] = {}