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

Method create_gnu_header

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

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

Callers 1

tobufMethod · 0.95

Calls 4

_create_headerMethod · 0.95
lenFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected