title: unzip file in python but don't change file created time
body: <p>I've tried multiple approaches to unzipping a file with Python, but each approach ends up with the wrong created time (because Python created a new copy of that file, not truly extracting it from the zipped file). For example, a file created on 2012-12-21 will show a creation date of today when extracted with Python, but if I use something else (like WinZip) the file creation time is not changed.</p>
  
  <p>Is there a way to unzip the file using Python without changing the creation time?</p>
  
  <p>@Jason Sperske, here is the code I am using:</p>
  
  <pre><code>   zf = zipfile.ZipFile(fn)
     for name in zf.namelist():
          filename = os.path.basename(name)
          zf.extract(name, filepath)
      zf.close()
  </code></pre>
  
  <p>another version:</p>
  
  <pre><code>zf = zipfile.ZipFile(fn)
  for name in zf.namelist():
      source = zf.open(name)
      target = open(os.path.join(filepath, filename), "wb")
      with source, target:
      shutil.copyfileobj(source, target)
  </code></pre>
  
  <p>I also called winzip from within python, it works but it's annoying. It opens lots of windows explore windows. </p>