Sorry again and thx for your patience 
Here is all the code (for sure this time, I promise
)
Code:
import zipfile
folder = "C:\\Python\\lib\\" ## place of the zip-file?
unpack_folder = "C:\\Python\\lib\\" ## where to put the unpacked files?
#file = "free.zip" ## name of an unprotected zip-file?
file = "protected.zip" ## name of a password protected zip-file?
def getzip(filename, ignoreable=100):
try:
return zipfile.ZipFile(filename)
except zipfile.BadZipfile:
original = open(filename, 'rb')
try:
data = original.read()
finally:
original.close()
position = data.rindex(zipfile.stringEndArchive,
-(22 + ignoreable), -20)
coredata = cStringIO.StringIO(data[: 22 + position])
return zipfile.ZipFile(coredata)
def unpack():
a = getzip(folder + file)
##Extract every file from it
for i in a.namelist():
#b = open(unpack_folder +i, 'wb') # if there is no password
b = open(unpack_folder +i, 'wb', 'abc') # if there is a password (password is 'abc')
b.write(a.read(i))
b.close()
##Close the archive
a.close()
unpack()
Non password protected zip-files are working fine.
The error message for all password protected zip-files is "TypeError: an integer is required"