How do I preserve symlinks when unzipping an archive using Python?
Question: Many zip archives (especially those include OS X applications) contain
symlinks. When using the `zipfile.extractall` method, symlinks are turned into
regular files. Anyone know how to preserve them as links?


Answer: There seems to be no way to do this using the zipfile module. I solved it
using the subprocess module:

    
    
    from subprocess import check_output, CalledProcessError, STDOUT
    
    try:
       check_output(['unzip', '-q', my_zipfile, '-d', destination], stderr=STDOUT)
    

...

    
    
    except CalledProcessError as err:
       (use err.cmd, err.returncode and err.output to take action)
    

