MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _unpack_tarfile

Function _unpack_tarfile

tools/python-3.11.9-amd64/Lib/shutil.py:1266–1278  ·  view source on GitHub ↗

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

(filename, extract_dir, *, filter=None)

Source from the content-addressed store, hash-verified

1264 zip.close()
1265
1266def _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

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