z = zipfile.ZipFile(targetFile, 'w')
path, filename = os.path.split(sourceFile)
bytes = file(sourceFile, 'rb')
info = zipfile.ZipInfo(filename)
info.external_attr = 33
z.writestr(info, bytes.read())
bytes.close()
z.close()
Preserve file attributes in ZipFile