MCPcopy Index your code
hub / github.com/python/cpython / create_gnu_header

Method create_gnu_header

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

1060 return self._create_header(info, USTAR_FORMAT, encoding, errors)
1061
1062 def create_gnu_header(self, info, encoding, errors):
1063 """Return the object as a GNU header block sequence.
1064 """
1065 info["magic"] = GNU_MAGIC
1066
1067 buf = b""
1068 if len(info["linkname"].encode(encoding, errors)) > LENGTH_LINK:
1069 buf += self._create_gnu_long_header(info["linkname"], GNUTYPE_LONGLINK, encoding, errors)
1070
1071 if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:
1072 buf += self._create_gnu_long_header(info["name"], GNUTYPE_LONGNAME, encoding, errors)
1073
1074 return buf + self._create_header(info, GNU_FORMAT, encoding, errors)
1075
1076 def create_pax_header(self, info, encoding):
1077 """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