fancycode / pylzma

Python bindings for the LZMA library
http://www.joachim-bauch.de/projects/pylzma/
GNU Lesser General Public License v2.1
234 stars 72 forks source link

Invalid type while parsing encrypted 7z file #41

Closed unconverged closed 6 years ago

unconverged commented 8 years ago

Hello! I'm trying to use py7zlib to read from an encrypted 7z file.

Here is my code:

import py7zlib

fp = open('12313213.7z', 'rb')
archive = py7zlib.Archive7z(fp)

Here is the sample file (the zip archive contains the target 7z file, becasue GitHub does not allow to attach 7z's, I'm not trying to open zip file with pylzma, of course): 12313213.zip

It produces the following error:

Traceback (most recent call last):
  File "/venv/main.py", line 4, in <module>
    archive = py7zlib.Archive7z(fp)
  File "\venv\lib\site-packages\py7zlib.py", line 811, in __init__
    self.header = Header(buffer)
  File "\venv\lib\site-packages\py7zlib.py", line 547, in __init__
    self.files = FilesInfo(file)
  File "\venv\lib\site-packages\py7zlib.py", line 527, in __init__
    raise FormatError('invalid type %r' % (typ))
py7zlib.FormatError: invalid type b'\x19'

I'm using Windows 10 x64 (Python is x32), Python 3.4.

fancycode commented 6 years ago

I know it's been some time, but could you please check if this is working with the latest master? After fixing #31 and implementing LZMA2 in #51 I can't reproduce this with the file you provided.

Feel free to reopen with a new sample file if this is still an issue.