EPUB Input: Ignore OPF files in the EPUB whose names start with a period

This commit is contained in:
Kovid Goyal 2010-10-01 03:38:16 -06:00
parent 028dbbcf9b
commit 8062c04b81

View File

@ -117,7 +117,8 @@ class EPUBInput(InputFormatPlugin):
encfile = os.path.abspath(os.path.join('META-INF', 'encryption.xml'))
opf = None
for f in walk(u'.'):
if f.lower().endswith('.opf') and '__MACOSX' not in f:
if f.lower().endswith('.opf') and '__MACOSX' not in f and \
not os.path.basename(f).startswith('.'):
opf = os.path.abspath(f)
break
path = getattr(stream, 'name', 'stream')