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

Method _proc_gnusparse_10

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

1597 next.sparse = list(zip(sparse[::2], sparse[1::2]))
1598
1599 def _proc_gnusparse_10(self, next, pax_headers, tarfile):
1600 """Process a GNU tar extended sparse header, version 1.0.
1601 """
1602 fields = None
1603 sparse = []
1604 buf = tarfile.fileobj.read(BLOCKSIZE)
1605 fields, buf = buf.split(b"\n", 1)
1606 fields = int(fields)
1607 while len(sparse) < fields * 2:
1608 if b"\n" not in buf:
1609 buf += tarfile.fileobj.read(BLOCKSIZE)
1610 number, buf = buf.split(b"\n", 1)
1611 sparse.append(int(number))
1612 next.offset_data = tarfile.fileobj.tell()
1613 next.sparse = list(zip(sparse[::2], sparse[1::2]))
1614
1615 def _apply_pax_info(self, pax_headers, encoding, errors):
1616 """Replace fields with supplemental information from a previous

Callers 1

_proc_paxMethod · 0.95

Calls 6

lenFunction · 0.85
listClass · 0.85
readMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected