From b27a2625cb69643b259ba586da5495418a3cebd4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 21 Jan 2011 14:43:43 -0700 Subject: [PATCH] Fix regression that broke MOBI output in the GUI --- src/calibre/ebooks/mobi/writer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index ed102ecc80..2a71ecd43b 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -1541,7 +1541,10 @@ class MobiWriter(object): exth.write(data) nrecs += 1 if term == 'rights' : - rights = unicode(oeb.metadata.rights[0]).encode('utf-8') + try: + rights = unicode(oeb.metadata.rights[0]).encode('utf-8') + except: + rights = 'Unknown' exth.write(pack('>II', EXTH_CODES['rights'], len(rights) + 8)) exth.write(rights)