python2.7 - python mammoth zipfile.BadZipfile: File is not a zip file
#mammoth 是一个将docx文件转换为HTML文件的库,执行报错如下
$ mammoth.exe test.docx test.html
Traceback (most recent call last):
File "d:\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "d:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "d:\Python27\Scripts\mammoth.exe\__main__.py", line 9, in <module>
File "d:\python27\lib\site-packages\mammoth\cli.py", line 33, in main
output_format=args.output_format,
File "d:\python27\lib\site-packages\mammoth\__init__.py", line 20, in convert
kwargs["style_map"] = read_style_map(fileobj)
File "d:\python27\lib\site-packages\mammoth\docx\style_map.py", line 66, in re
ad_style_map
with open_zip(fileobj, "r") as zip_file:
File "d:\python27\lib\site-packages\mammoth\zips.py", line 9, in open_zip
return _Zip(ZipFile(fileobj, mode))
File "d:\python27\lib\zipfile.py", line 770, in __init__
self._RealGetContents()
File "d:\python27\lib\zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file