From e1dc8a61578ab05fecce261fd9d5ff10d17d7954 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 May 2012 17:52:14 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/html/input.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index 6cacb34edc..06823140a6 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -113,6 +113,9 @@ class HTMLFile(object): raise IOError(msg) raise IgnoreFile(msg, err.errno) + if not src: + raise ValueError('The file %s is empty'%self.path) + if not self.is_binary: if not encoding: encoding = detect_xml_encoding(src[:4096], verbose=verbose)[1]