Skip to content Skip to sidebar Skip to footer

Extracting Large Files With Zipfile

I'm trying to extract a zip file of 1.23 GB with zipFile library. But it gives the following error: compression type 9 (deflate64) Here's my code: zip_ref = zipfile.ZipFile(filep

Solution 1:

This happens because that compression method is not implemented in the zipfile module.

Some discussion about the issue is here: https://bugs.python.org/issue14313

The fix was to raise a NotImplementedError instead of adding support for the compression method.

Suggested solutions:

  • If possible, recompress the file using a standard deflate method.
  • Use the subprocess module to invoke the system unzip command, asssuming it is installed on your OS (if it supports that compression method, I'm honestly not sure. I know that 7-zip supports the method.).

Post a Comment for "Extracting Large Files With Zipfile"