title: Python: permission denied when extracting tar.gz
body: <p>I would like to extract all tar.gz inside a folder but I am getting [Errno 13] Permission denied. I have been through different posts related to the problem but nothing helps. Even extracting a specific member inside tar.gz gives same error. Can someone help what could be wrong?</p>
  
  <p><a href="https://stackoverflow.com/questions/30887979/i-want-to-create-a-script-for-unzip-tar-gz-file-via-python">I want to create a script for unzip (.tar.gz) file via (Python)</a></p>
  
  <p><a href="https://stackoverflow.com/questions/35865099/python-extracting-specific-files-with-pattern-from-tar-gz-without-extracting-th">Python: Extracting specific files with pattern from tar.gz without extracting the complete file</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7237475/overwrite-existing-read-only-files-when-using-pythons-tarfile">Overwrite existing read-only files when using Python&#39;s tarfile</a></p>
  
  <pre><code>tar = tarfile.open(fname, "r:gz")
  tar.extractall()
  tar.close()
  </code></pre>