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

Method _proc_gnusparse_00

Lib/tarfile.py:1573–1591  ·  view source on GitHub ↗

Process a GNU tar extended sparse header, version 0.0.

(self, next, raw_headers)

Source from the content-addressed store, hash-verified

1571 return next
1572
1573 def _proc_gnusparse_00(self, next, raw_headers):
1574 """Process a GNU tar extended sparse header, version 0.0.
1575 """
1576 offsets = []
1577 numbytes = []
1578 for _, keyword, value in raw_headers:
1579 if keyword == b"GNU.sparse.offset":
1580 try:
1581 offsets.append(int(value.decode()))
1582 except ValueError:
1583 raise InvalidHeaderError("invalid header")
1584
1585 elif keyword == b"GNU.sparse.numbytes":
1586 try:
1587 numbytes.append(int(value.decode()))
1588 except ValueError:
1589 raise InvalidHeaderError("invalid header")
1590
1591 next.sparse = list(zip(offsets, numbytes))
1592
1593 def _proc_gnusparse_01(self, next, pax_headers):
1594 """Process a GNU tar extended sparse header, version 0.1.

Callers 1

_proc_paxMethod · 0.95

Calls 4

InvalidHeaderErrorClass · 0.85
listClass · 0.85
appendMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected