Closed ganego closed 4 years ago
I cannot reproduce with a file that produced by a procedure you post. A produced files become 'LZMA2:BCJ' in my environment.
I've just create another file by7z a -m1=LZMA -mf=BCJ test.7z test1.txt
. Is it produce a same error you got?
Could you upload a test file that reproduce a case? a.zip
With the fixes applied I no longer get any crashes for several different BCJ archives I created.
But I tested another variant that still crashes. See this site: https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm and scroll down to Supported filters
for 7z.
BCJ2 crashes with Unknown method b'\x03\x03\x01\x1b'
All other tested filters work fine with either LZMA or LZMA2.
EDIT: Since I just looked a bit through the code I saw py7zr.properties.CompressionMethod
. Now compared to that, py7zr.compression.get_methods_names
lacks lots of strings, so it will also crash for example for archives created with -m0=COPY
for example.
Python core do not support BCJ2. so py7zr also not support it. If you want to support, please contribute to liblzma, which is linked with python core library.
It should still not crash .archiveinfo(). It should just return the requested information about the archive.
If extracting is not supported that is fine, but should raise an exception when extracting, not when requesting archive information.
For example I do not need to extract anything, I just need information if an archive is solid.
Thank you
It is not crash, You should try-catch py7zr.exceptions.UnsupportedCompressionMethodError properly.
Describe the bug py7zr throws UnsupportedCompressionMethodError when opening a file and retrieving .archiveinfo()
To Reproduce Create a BCJ archive:
7z a -mf=BCJ test.7z test.txt
(create some test.txt before...) Verify with 7z that it's BCJ - my archive was LZMA:12k BCJ. Open file with 7zr and use archiveinfo().Crash:
Environment (please complete the following information):