return correct (dummy) doc properties in case of error
This commit is contained in:
parent
19b50d9e8f
commit
9024ca99e1
1 changed files with 3 additions and 2 deletions
|
@ -78,15 +78,16 @@ class OfficeFile(ExternalFileAdapter):
|
|||
@Lazy
|
||||
def docPropertyDom(self):
|
||||
fn = self.docFilename
|
||||
dummy = dict(core=[], custom=[])
|
||||
root, ext = os.path.splitext(fn)
|
||||
if not ext.lower() in self.fileExtensions:
|
||||
return []
|
||||
return dummy
|
||||
try:
|
||||
zf = ZipFile(fn, 'r')
|
||||
except IOError, e:
|
||||
from logging import getLogger
|
||||
self.logger.warn(e)
|
||||
return []
|
||||
return dummy
|
||||
if self.corePropFileName not in zf.namelist():
|
||||
self.logger.warn('Core properties not found in file %s.' %
|
||||
self.externalAddress)
|
||||
|
|
Loading…
Add table
Reference in a new issue