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

Method create_gnu_header

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

Return the object as a GNU header block sequence.

(self, info, encoding, errors)

Source from the content-addressed store, hash-verified

1009 return self._create_header(info, USTAR_FORMAT, encoding, errors)
1010
1011 def create_gnu_header(self, info, encoding, errors):
1012 """Return the object as a GNU header block sequence.
1013 """
1014 info["magic"] = GNU_MAGIC
1015
1016 buf = b""
1017 if len(info["linkname"].encode(encoding, errors)) > LENGTH_LINK:
1018 buf += self._create_gnu_long_header(info["linkname"], GNUTYPE_LONGLINK, encoding, errors)
1019
1020 if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:
1021 buf += self._create_gnu_long_header(info["name"], GNUTYPE_LONGNAME, encoding, errors)
1022
1023 return buf + self._create_header(info, GNU_FORMAT, encoding, errors)
1024
1025 def create_pax_header(self, info, encoding):
1026 """Return the object as a ustar header block. If it cannot be

Callers 1

tobufMethod · 0.95

Calls 3

_create_headerMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected