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

Method _extract_one

Lib/tarfile.py:2511–2529  ·  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

2509 return filtered, unfiltered
2510
2511 def _extract_one(self, tarinfo, path, set_attrs, numeric_owner,
2512 filter_function=None):
2513 """Extract from filtered tarinfo to disk.
2514
2515 filter_function is only used when extracting a *different*
2516 member (e.g. as fallback to creating a symlink)
2517 """
2518 self._check("r")
2519
2520 try:
2521 self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
2522 set_attrs=set_attrs,
2523 numeric_owner=numeric_owner,
2524 filter_function=filter_function,
2525 extraction_root=path)
2526 except (OSError, UnicodeEncodeError) as e:
2527 self._handle_fatal_error(e)
2528 except ExtractError as e:
2529 self._handle_nonfatal_error(e)
2530
2531 def _handle_nonfatal_error(self, e):
2532 """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