Closed ghost closed 6 years ago
I have hit the same issue (both the invalid type '\x19' and the UnsupportedCompressionMethodError issue.)
I don't have control over the process that's compressing these files. I'm hoping that someone has found a workaround for this.
FYI: I tried @Marginal's code (https://github.com/Marginal/pylzma) and still have the issue when opening 7z files created by NetApp's ONTAP operating system (assuming @aaronsims-netapp has the same issue).
File "/usr/local/lib/python2.7/dist-packages/pylzma-0.4.8_14_gaea5dev-py2.7-linux-x86_64.egg/py7zlib.py", line 612, in read
raise UnsupportedCompressionMethodError(repr(coder['method']))
py7zlib.UnsupportedCompressionMethodError: '!'
EDIT: the invalid type issue seems to be gone, its just the UnsupportedCompressionMethodError remaining.
Further info:
libmagic identifies the 7z file I'm having a problem with as:
body.7z: 7-zip archive data, version 0.4
version 0.3 and prior have no issue.
In the ArchiveFile.read(), in the for loop for coder in self._folder.coders:
With both a version 0.3 7z file and a version 0.4 7z file, on first call of the read() function, the coder
pointer is:
{'numinstreams': 1, 'numoutstreams': 1, 'method': '\\x03\\x01\\x01', 'properties': ']\\x00`\\x00\\x00'}
On second call of the read() function:
version 0.3 is: {'numinstreams': 1, 'numoutstreams': 1, 'method': '\\x03\\x01\\x01', 'properties': ']\\x00`\\x00\\x00'}
version 0.4 is: "{'numinstreams': 1, 'numoutstreams': 1, 'method': '!', 'properties': '\\x04'}
This is what's throwing the error.
Further information.
The file in question extracts without issue using 7-zip and p7zip version 9.20
Could you please provide a small example file that can be used to reproduce the error?
Yes, however it might contain confidential information so am I able to send outside of this thread?
Sure, you should see my email address in my profile. However a small public file would be great, so I could add it as testcase if/when the problem is solved.
I've sent you the confidential one. I'll try to get you one that can be public. Stay tuned.
This file has the same issue (was created with Keka for Mac version 1.1.1 (2733).
Sorry it had to be zipped as GitHub doesn't allow uploading of 7z files.
I am using osx (10.11) and python 2.7 and I used keka to compress the files into an archive. The default pip version (pylzma-0.4.8) gives the error
invalid type '\x19'
This is fixed in the version from github, I can read the filenames and sizes! ...but reading the data always results into an exception with
UnsupportedCompressionMethodError: '!'
I saw the warning about multithreading, so my questions are: Are files compressed with keka, (i also tried betterzip) just not readable due to a missing compression method? Do I have to disable multithreading (how?) as suggested when running setup.py install to get this to work?
My code snippet Code