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

Method create_ustar_header

Lib/tarfile.py:1051–1062  ·  view source on GitHub ↗

Return the object as a ustar header block.

(self, info, encoding, errors)

Source from the content-addressed store, hash-verified

1049 raise ValueError("invalid format")
1050
1051 def create_ustar_header(self, info, encoding, errors):
1052 """Return the object as a ustar header block.
1053 """
1054 info["magic"] = POSIX_MAGIC
1055
1056 if len(info["linkname"].encode(encoding, errors)) > LENGTH_LINK:
1057 raise ValueError("linkname is too long")
1058
1059 if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:
1060 info["prefix"], info["name"] = self._posix_split_name(info["name"], encoding, errors)
1061
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.

Callers 1

tobufMethod · 0.95

Calls 4

_posix_split_nameMethod · 0.95
_create_headerMethod · 0.95
lenFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected