Skip to content
Advertisement

Python zipfile compress_size returns ‘int’ object is not callable

I am trying to get the compressed size of a file with Python and zipfile

JavaScript

I get the error

JavaScript

What is the reason for that?

Advertisement

Answer

ZipInfo.compress_size is a simple int attribute, not a method, so you just need to do

JavaScript

BTW, it’s a Bad Idea to use zip as the name of a variable, as it’s the name of a built-in function.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement