Return the object as a ustar header block.
(self, info, encoding, errors)
| 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. |
no test coverage detected