From d9cd3fd0b0b77185c7be38bf300815777e884be3 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 4 Dec 2010 14:10:35 +0000 Subject: [PATCH] Fix problem with sorting in collections --- src/calibre/devices/usbms/books.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index 4a74f68349..9e19e9c66d 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -237,7 +237,10 @@ class CollectionsBookList(BookList): return 1 if y is None: return -1 - c = cmp(sort_key(x), sort_key(y)) + if isinstance(x, unicode): + c = cmp(sort_key(x), sort_key(y)) + else: + c = cmp(x, y) if c != 0: return c # same as above -- no sort_key needed here