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