【发布时间】:2018-06-27 02:10:03
【问题描述】:
使用python's zipfile 模块,我无法打开加密的 zip 文件,我发现压缩类型为 99。我可以使用 WinZip 打开它,但我想使用 python 自动执行该过程。
我应该考虑使用 7zip 的命令行还是 zipfile 模块本身有什么方法可以解决这个问题?谢谢!
RuntimeError Traceback (most recent call last)
<ipython-input-43-4c4765b40715> in <module>()
3 print (info.filename, info.date_time, info.file_size, info.compress_type)
4 myzip.setpassword(b'password')
5 with myzip.open('641903.txt','r') as myfile:<-----
6 print(myfile.readline()
641903.txt (2018, 6, 26, 11, 59, 50) 342 99
RuntimeError: Bad password for file '641903.txt'
【问题讨论】:
-
你没有传入密码参数吗?