Using Python TarFile.extractall to decompress a tarball
suggest changefile_untar = 'filename.tar.gz'
untar = tarfile.TarFile(file_untar)
untar.extractall()
untar.close()
tarfile is not imported in this fragment, and filename.tar.gz is not in this book. tarfile.TarFile reads an uncompressed tar archive. Opening a gzip-compressed tarball that way raises tarfile.ReadError. Use tarfile.open(file_untar, 'r:gz') for this filename.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents