Unpack tar/tar.gz/tar.bz2/tar.xz/tar.zst `filename` to `extract_dir`
(filename, extract_dir, *, filter=None)
| 1337 | zip.close() |
| 1338 | |
| 1339 | def _unpack_tarfile(filename, extract_dir, *, filter=None): |
| 1340 | """Unpack tar/tar.gz/tar.bz2/tar.xz/tar.zst `filename` to `extract_dir` |
| 1341 | """ |
| 1342 | import tarfile # late import for breaking circular dependency |
| 1343 | try: |
| 1344 | tarobj = tarfile.open(filename) |
| 1345 | except tarfile.TarError: |
| 1346 | raise ReadError( |
| 1347 | "%s is not a compressed or uncompressed tar file" % filename) |
| 1348 | try: |
| 1349 | tarobj.extractall(extract_dir, filter=filter) |
| 1350 | finally: |
| 1351 | tarobj.close() |
| 1352 | |
| 1353 | # Maps the name of the unpack format to a tuple containing: |
| 1354 | # * extensions |
nothing calls this directly
no test coverage detected