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

kDummy not handled - cannot open file created with p7zip Version 9.38.1 #37

Closed netrix closed 8 years ago

netrix commented 8 years ago

Full info about version: p7zip Version 9.38.1 (locale=en_US.utf8,Utf16=on,HugeFiles=on,4 CPUs,ASM)

The archive created with this version of p7zip cannot be opened by this lib because it lacks handling of Dummy parameter. The error I've received is:

FormatError: invalid type b'\x19'

from:

in () ----> 1 archive = py7zlib.Archive7z(fp) ``` /usr/lib/python3.5/site-packages/py7zlib.py in __init__(self, file, password) 809 return 810 --> 811 self.header = Header(buffer) 812 files = self.header.files 813 folders = self.header.main_streams.unpackinfo.folders /usr/lib/python3.5/site-packages/py7zlib.py in __init__(self, file) 545 546 if id == PROPERTY_FILES_INFO: --> 547 self.files = FilesInfo(file) 548 id = file.read(1) 549 /usr/lib/python3.5/site-packages/py7zlib.py in __init__(self, file) 525 f['attributes'] = None 526 else: --> 527 raise FormatError('invalid type %r' % (typ)) 528 ``` From spec please see: > 0x17 = kEncodedHeader > > 0x18 = kStartPos > 0x19 = kDummy There are 2 more properties in spec that are not handled by this library. I cannot see what is kStartPos for by I may assume that kDummy should do just nothing.
BeigeOne commented 8 years ago

I was just about to post this issue too.

I created the archive with 7-Zip [32] 15.06 beta.

I note that these headers did not exist in some older versions of the 7z Format description (7zFormat.txt) - I could not find many old versions, but located 2.30 Beta 25 (current version is 4.59).

BeigeOne commented 8 years ago

I just replicated this error with the latest version: 7-Zip [32] 15.14