From 85bb1dbeec9a3b129dada0b0c0f29e174e77a508 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 May 2015 10:14:51 +0530 Subject: [PATCH] DOCX Input: Handle DOCX files that are missing a settings.xml file, despite it being listed in the manifest --- src/calibre/ebooks/docx/to_html.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/to_html.py b/src/calibre/ebooks/docx/to_html.py index 36cfb6125a..32c3d42a0a 100644 --- a/src/calibre/ebooks/docx/to_html.py +++ b/src/calibre/ebooks/docx/to_html.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' -import sys, os, re, math +import sys, os, re, math, errno from collections import OrderedDict, defaultdict from lxml import html @@ -282,6 +282,10 @@ class Convert(object): seraw = self.docx.read(sename) except KeyError: self.log.warn('Settings %s do not exist' % sename) + except EnvironmentError as e: + if e.errno != errno.ENOENT: + raise + self.log.warn('Settings %s file missing' % sename) else: self.settings(fromstring(seraw))