I have a script that creates zip files of dirs containing symlinks. I was surprised to find that the zipfiles have zipped the targets of the links as opposed to the links th
I have defined the following method in a Zip support class
def add_symlink(self, link, target, permissions=0o777):
self.log('Adding a symlink: {} => {}'.format(link, target))
permissions |= 0xA000
zi = zipfile.ZipInfo(link)
zi.create_system = 3
zi.external_attr = permissions << 16
self.zip.writestr(zi, target)