miurahr / py7zr

7zip in python3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2, and Deflate compressions, and AES encryption.

Home Page:https://pypi.org/project/py7zr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

py7zr fails to extract a specific encrypted archive

lorddevereux opened this issue · comments

I have a 7z archive created using 7zip 16.02 64bit on Ubuntu.
My client is using py7zr 0.21 on Python 3.8.11 on an embedded Linux machine.

The file has a password and encrypted headers.
The problem is that the file cannot be extracted on the client machine. The traceback:

Traceback (most recent call last):
File "<my_application_code>", line 285, in <my_function>
package.extractall(UPDATE_TEMP_PATH)
File "/usr/lib/python3.8/site-packages/py7zr/py7zr.py", line 981, in extractall
self._extract(path=path, return_dict=False, callback=callback)
File "/usr/lib/python3.8/site-packages/py7zr/py7zr.py", line 622, in _extract
self.worker.extract(
File "/usr/lib/python3.8/site-packages/py7zr/py7zr.py", line 1247, in extract
self.extract_single(
File "/usr/lib/python3.8/site-packages/py7zr/py7zr.py", line 1316, in extract_single
raise e
File "/usr/lib/python3.8/site-packages/py7zr/py7zr.py", line 1313, in extract_single
self._extract_single(fp, files, path, src_end, q, skip_notarget)
File "/usr/lib/python3.8/site-packages/py7zr/py7zr.py", line 1385, in _extract_single
raise CrcError(crc32, f.crc32, f.filename)
py7zr.exceptions.CrcError: (611537137, 3286897721, '2004.sh')

7za binary is able to extract this archive without problems.

I tested the same archive using py7zr on Python 3.10.12 (on the Ubuntu machine), and it's ok.

I can share the test data privately/by email.

Thanks - if I can give more information let me know