Unpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
(filename, extract_dir, *, filter=None)
| 1264 | zip.close() |
| 1265 | |
| 1266 | def _unpack_tarfile(filename, extract_dir, *, filter=None): |
| 1267 | """Unpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir` |
| 1268 | """ |
| 1269 | import tarfile # late import for breaking circular dependency |
| 1270 | try: |
| 1271 | tarobj = tarfile.open(filename) |
| 1272 | except tarfile.TarError: |
| 1273 | raise ReadError( |
| 1274 | "%s is not a compressed or uncompressed tar file" % filename) |
| 1275 | try: |
| 1276 | tarobj.extractall(extract_dir, filter=filter) |
| 1277 | finally: |
| 1278 | tarobj.close() |
| 1279 | |
| 1280 | # Maps the name of the unpack format to a tuple containing: |
| 1281 | # * extensions |
nothing calls this directly
no test coverage detected