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

Method create_ustar_header

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

Return the object as a ustar header block.

(self, info, encoding, errors)

Source from the content-addressed store, hash-verified

996 raise ValueError("invalid format")
997
998 def create_ustar_header(self, info, encoding, errors):
999 """Return the object as a ustar header block.
1000 """
1001 info["magic"] = POSIX_MAGIC
1002
1003 if len(info["linkname"].encode(encoding, errors)) > LENGTH_LINK:
1004 raise ValueError("linkname is too long")
1005
1006 if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:
1007 info["prefix"], info["name"] = self._posix_split_name(info["name"], encoding, errors)
1008
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.

Callers 1

tobufMethod · 0.95

Calls 3

_posix_split_nameMethod · 0.95
_create_headerMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected