1

I want to open an 7zip file in python and used the py7zr library but getting following error:

CrcError: (3945015320, 1928216475, '1_Microsoft Outlook - Memoformat (3).tif')

I tried the following code:

archive= py7zr.SevenZipFile('path', mode='r',password="mypw")
archive.reset()
archive.extractall()
archive.close()

I checked with archive.test() and received None - In my understanding the crc value is missing.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
oluo.acn
  • 39
  • 2
  • The error is telling you that the file's CRC doesn't match, not that it's missing. Are you sure the password is correct? Compression utilities don't store the password in the file itself. They'll decompress their contents using the password, compare the checksums and only then tell you that the checksums don't match. – Panagiotis Kanavos Feb 28 '23 at 09:25
  • Have you tried extracting or testing the files with 7z ? If that doesn't work, `py7zr` won't either – Panagiotis Kanavos Feb 28 '23 at 09:26
  • if the `.test()` method returns `None`, it [does seem to indicate a CRC record is missing](https://py7zr.readthedocs.io/en/latest/api.html#py7zr.SevenZipFile.test) – Saaru Lindestøkke Feb 28 '23 at 09:27
  • @PanagiotisKanavos your guess was right, password was wrong Error message could be improved tho, since I had 0 idea what CRC is – oluo.acn Mar 13 '23 at 15:02

1 Answers1

0

The password from my client was incorrect - thank you for the help!

oluo.acn
  • 39
  • 2