MCPcopy Index your code
hub / github.com/python/cpython / _unpack_tarfile

Function _unpack_tarfile

Lib/shutil.py:1342–1354  ·  view source on GitHub ↗

Unpack tar/tar.gz/tar.bz2/tar.xz/tar.zst `filename` to `extract_dir`

(filename, extract_dir, *, filter=None)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

ReadErrorClass · 0.70
openMethod · 0.45
extractallMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…