提取.zip文件在python
问题描述:
我BadZipfile: Bad magic number for file header
错误,而当解压给file #1: bad zipfile offset (local header sig): 0
提取,但在使用jar -xf file.zip
命令被退出码2提取.zip文件在python
提取提取使用python2 zipfile.ZipFile
同一个.zip一个.zip完成$? == 0
,没有任何提取。
使用文件给出:
file -i file.zip
file.zip application/octet-stream; charset=binary
这为zip文件
$ hexdump -C file.zip | head -10
00000000 50 67 f0 de 1e 7a 29 e4 93 56 3f 11 a2 5f b6 97 |Pg...z)..V?.._..|
正确的标题不正确头:
00000000 50 4b 03 04 14 00 08 08 08 00 28 3e 4b 4b 00 00 |PK........(>KK..|
为什么被列为应用程序/八位字节流文件?
我对
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
怎么回事?这是什么文件格式?任何指针?
您是否尝试了其他所有方法:'gzip','unzip'? – RomanPerekhrest
也许档案已损坏? – sotona
[Python中的ZipFile模块出现错误的数字错误]的可能重复(https://stackoverflow.com/questions/7703639/bad-magic-number-error-with-zipfile-module-in-python) –