MCPcopy Index your code
hub / github.com/RustPython/RustPython / extract

Method extract

Lib/tarfile.py:2461–2479  ·  view source on GitHub ↗

Extract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. 'member' may be a filename or a TarInfo object. You can specify a different directory using 'path'. File attributes (

(self, member, path="", set_attrs=True, *, numeric_owner=False,
                filter=None)

Source from the content-addressed store, hash-verified

2459 (member.name, reason))
2460
2461 def extract(self, member, path="", set_attrs=True, *, numeric_owner=False,
2462 filter=None):
2463 """Extract a member from the archive to the current working directory,
2464 using its full name. Its file information is extracted as accurately
2465 as possible. 'member' may be a filename or a TarInfo object. You can
2466 specify a different directory using 'path'. File attributes (owner,
2467 mtime, mode) are set unless 'set_attrs' is False. If 'numeric_owner'
2468 is True, only the numbers for user/group names are used and not
2469 the names.
2470
2471 The 'filter' function will be called before extraction.
2472 It can return a changed TarInfo or None to skip the member.
2473 String names of common filters are accepted.
2474 """
2475 filter_function = self._get_filter_function(filter)
2476 tarinfo, unfiltered = self._get_extract_tarinfo(
2477 member, filter_function, path)
2478 if tarinfo is not None:
2479 self._extract_one(tarinfo, path, set_attrs, numeric_owner)
2480
2481 def _get_extract_tarinfo(self, member, filter_function, path):
2482 """Get (filtered, unfiltered) TarInfos from *member*

Callers

nothing calls this directly

Calls 3

_get_filter_functionMethod · 0.95
_get_extract_tarinfoMethod · 0.95
_extract_oneMethod · 0.95

Tested by

no test coverage detected