title: copy file, keep permissions and owner
body: <p>The docs of shutil tells me:</p>
  
  <blockquote>
    <p>Even the higher-level file copying functions (shutil.copy(), shutil.copy2()) can’t copy all file metadata. On POSIX platforms, this means that file owner and group are lost as well as ACLs</p>
  </blockquote>
  
  <p>How can I keep the file owner and group if I need to copy a file in python?</p>
  
  <p>The process runs on linux as root.</p>
  
  <p>Update: We don't use ACLs. We only need to keep the stuff which is preserved with tools like tar and rsync.</p>