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

Method _create_gnu_long_header

Lib/tarfile.py:1211–1225  ·  view source on GitHub ↗

Return a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name.

(cls, name, type, encoding, errors)

Source from the content-addressed store, hash-verified

1209
1210 @classmethod
1211 def _create_gnu_long_header(cls, name, type, encoding, errors):
1212 """Return a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
1213 for name.
1214 """
1215 name = name.encode(encoding, errors) + NUL
1216
1217 info = {}
1218 info["name"] = "././@LongLink"
1219 info["type"] = type
1220 info["size"] = len(name)
1221 info["magic"] = GNU_MAGIC
1222
1223 # create extended header + name blocks.
1224 return cls._create_header(info, USTAR_FORMAT, encoding, errors) + \
1225 cls._create_payload(name)
1226
1227 @classmethod
1228 def _create_pax_generic_header(cls, pax_headers, type, encoding):

Callers 1

create_gnu_headerMethod · 0.95

Calls 4

lenFunction · 0.85
_create_headerMethod · 0.80
_create_payloadMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected