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

Method _extract_one

Lib/tarfile.py:2530–2548  ·  view source on GitHub ↗

Extract from filtered tarinfo to disk. filter_function is only used when extracting a *different* member (e.g. as fallback to creating a symlink)

(self, tarinfo, path, set_attrs, numeric_owner,
                     filter_function=None)

Source from the content-addressed store, hash-verified

2528 return filtered, unfiltered
2529
2530 def _extract_one(self, tarinfo, path, set_attrs, numeric_owner,
2531 filter_function=None):
2532 """Extract from filtered tarinfo to disk.
2533
2534 filter_function is only used when extracting a *different*
2535 member (e.g. as fallback to creating a symlink)
2536 """
2537 self._check("r")
2538
2539 try:
2540 self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
2541 set_attrs=set_attrs,
2542 numeric_owner=numeric_owner,
2543 filter_function=filter_function,
2544 extraction_root=path)
2545 except (OSError, UnicodeEncodeError) as e:
2546 self._handle_fatal_error(e)
2547 except ExtractError as e:
2548 self._handle_nonfatal_error(e)
2549
2550 def _handle_nonfatal_error(self, e):
2551 """Handle non-fatal error (ExtractError) according to errorlevel"""

Callers 2

extractallMethod · 0.95
extractMethod · 0.95

Calls 5

_checkMethod · 0.95
_extract_memberMethod · 0.95
_handle_fatal_errorMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected