python2.7 - python mammoth zipfile.BadZipfile: File is not a zip file
ringa_lee
ringa_lee 2017-04-18 09:50:07
[Python讨论组]
#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
ringa_lee
ringa_lee

ringa_lee

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号