Backport of CPython tarfile module
