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

Problem decompressing encrypted 7z archive? #33

Closed rsm-gh closed 8 years ago

rsm-gh commented 8 years ago

I think I may have found a problem when decompressing encrypted 7z archives. When trying to decompress a file I just did, I get the following error:

Traceback (most recent call last):
  File "test2.py", line 5, in <module>
    archive = Archive7z(f, password='abc')
  File "/usr/local/lib/python3.4/dist-packages/py7zlib.py", line 796, in __init__
    raise FormatError('invalid block data')
py7zlib.FormatError: invalid block data

The code I used for this was:

from py7zlib import Archive7z

with open('./abc.7z', 'rb') as f:
    archive = Archive7z(f, password='abc')

I was using python3.4 on Debian Jessie, and I installed pylzma trough python pip. The 7z archive was created from the command line with p7zip.

I attached the archive as a .zip because GitHub didn't accepted .7z files. abc.zip

Thanks for the help!