def create_pax_header(self, info, encoding):
info["<STR_LIT>"] = POSIX_MAGIC<EOL>pax_headers = self.pax_headers.copy()<EOL>for name, hname, length in (<EOL>("<STR_LIT:name>", "<STR_LIT:path>", LENGTH_NAME), ("<STR_LIT>", "<STR_LIT>", LENGTH_LINK),<EOL>("<STR_LIT>", "<STR_LIT>", <NUM_LIT:32>), ("<STR_LIT>", "<STR_LIT>", <NUM_LIT:32>)):<EOL><INDENT>if hname in pax_headers:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>info[name].encode("<STR_LIT:ascii>", "<STR_LIT:strict>")<EOL><DEDENT>except UnicodeEncodeError:<EOL><INDENT>pax_headers[hname] = info[name]<EOL>continue<EOL><DEDENT>if len(info[name]) > length:<EOL><INDENT>pax_headers[hname] = info[name]<EOL><DEDENT><DEDENT>for name, digits in (("<STR_LIT>", <NUM_LIT:8>), ("<STR_LIT>", <NUM_LIT:8>), ("<STR_LIT:size>", <NUM_LIT:12>), ("<STR_LIT>", <NUM_LIT:12>)):<EOL><INDENT>if name in pax_headers:<EOL><INDENT>info[name] = <NUM_LIT:0><EOL>continue<EOL><DEDENT>val = info[name]<EOL>if not <NUM_LIT:0> <= val < <NUM_LIT:8> ** (digits - <NUM_LIT:1>) or isinstance(val, float):<EOL><INDENT>pax_headers[name] = str(val)<EOL>info[name] = <NUM_LIT:0><EOL><DEDENT><DEDENT>if pax_headers:<EOL><INDENT>buf = self._create_pax_generic_header(pax_headers, XHDTYPE, encoding)<EOL><DEDENT>else:<EOL><INDENT>buf = b"<STR_LIT>"<EOL><DEDENT>return buf + self._create_header(info, USTAR_FORMAT, "<STR_LIT:ascii>", "<STR_LIT:replace>")<EOL>
Return the object as a ustar header block. If it cannot be
           represented this way, prepend a pax extended header sequence
           with supplement information.