From fcdc318a69256c2757fcc7482a3bed5298c5b3d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 6 Aug 2008 14:39:20 -0700 Subject: [PATCH] Fix handling of MOBI files with bogus codepages. --- src/calibre/ebooks/mobi/reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 9c5ba7839f..7053b7591f 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -93,7 +93,7 @@ class BookHeader(object): 1252 : 'cp1252', 65001 : 'utf-8', }[self.codepage] - except IndexError, KeyError: + except (IndexError, KeyError): print '[WARNING] Unknown codepage %d. Assuming cp-1252'%self.codepage self.codec = 'cp1252'