def extract_to_path(archive, member, path, user):
 upperdirs = os.path.dirname(path)
 if (upperdirs and (not os.path.exists(upperdirs))):
  os.makedirs(upperdirs)
 with archive.open(member) as source:
  with file(path, 'wb') as target:
   shutil.copyfileobj(source, target)
 if hasattr(member, 'date_time'):
  timestamp = calendar.timegm(member.date_time)
  os.utime(path, (timestamp, timestamp))
 ug = '{}:{}'.format(user, user)
 subprocess.call(['chown', '-R', ug, path])

def extract_to_path ( archive , member , path , user ) : upperdirs = os . path . dirname ( path ) if ( upperdirs and ( not os . path . exists ( upperdirs ) ) ) : os . makedirs ( upperdirs ) with archive . open ( member ) as source : with file ( path , 'wb' ) as target : shutil . copyfileobj ( source , target ) if hasattr ( member , 'date_time' ) : timestamp = calendar . timegm ( member . date_time ) os . utime ( path , ( timestamp , timestamp ) ) ug = '{}:{}' . format ( user , user ) subprocess . call ( [ 'chown' , '-R' , ug , path ] )
extract from the zip archive archive the member member and write it to path .