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

Method _proc_gnusparse_10

tools/python-3.11.9-amd64/Lib/tarfile.py:1520–1534  ·  view source on GitHub ↗

Process a GNU tar extended sparse header, version 1.0.

(self, next, pax_headers, tarfile)

Source from the content-addressed store, hash-verified

1518 next.sparse = list(zip(sparse[::2], sparse[1::2]))
1519
1520 def _proc_gnusparse_10(self, next, pax_headers, tarfile):
1521 """Process a GNU tar extended sparse header, version 1.0.
1522 """
1523 fields = None
1524 sparse = []
1525 buf = tarfile.fileobj.read(BLOCKSIZE)
1526 fields, buf = buf.split(b"\n", 1)
1527 fields = int(fields)
1528 while len(sparse) < fields * 2:
1529 if b"\n" not in buf:
1530 buf += tarfile.fileobj.read(BLOCKSIZE)
1531 number, buf = buf.split(b"\n", 1)
1532 sparse.append(int(number))
1533 next.offset_data = tarfile.fileobj.tell()
1534 next.sparse = list(zip(sparse[::2], sparse[1::2]))
1535
1536 def _apply_pax_info(self, pax_headers, encoding, errors):
1537 """Replace fields with supplemental information from a previous

Callers 1

_proc_paxMethod · 0.95

Calls 5

listFunction · 0.85
readMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected