daide2012
code&poetry
2017-04-14 12:59

fastdfs python客户端下载文件问题

5
  • fastdfs

遇到一个很奇怪的问题,从服务端下载压缩文件的的时候,再用zipfile解压时,说格式错误,不是正确的压缩问价,而用Java下载文件又没有问题,什么情况

我的代码:
client = Fdfs_client(self.m_clientConf)
localFileName = os.path.join(config.apksPath,apkMd5 + '.apk');
down_status = client.download_to_file(localFileName,remoteUrl)

然后用ZipFile解压报错:

Traceback (most recent call last):
File "D:/Projects/PythonProjects/androguard/pliblyze.py", line 220, in mfMainOperate
androguard = Androguard([options.input])
File "D:\Projects\PythonProjects\androguard\androguard\core\androgen.py", line 98, in init
self._analyze()
File "D:\Projects\PythonProjects\androguard\androguard\core\androgen.py", line 112, in analyze
x = apk.APK( i )
File "D:\Projects\PythonProjects\androguard\androguard\core\bytecodes\apk.py", line 186, in __init
_
self.zip = zipfile.ZipFile(StringIO.StringIO(self.__raw), mode=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"
BadZipfile: File is not a zip file

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答