'Return the object as a ustar header block. If it cannot be
represented this way, prepend a pax extended header sequence
with supplement information.'

def create_pax_header(self, info, encoding, errors):

    info['magic'] = POSIX_MAGIC
    pax_headers = self.pax_headers.copy()
    for (name, hname, length) in (('name', 'path', LENGTH_NAME), ('linkname', 'linkpath', LENGTH_LINK), ('uname', 'uname', 32), ('gname', 'gname', 32)):
        if (hname in pax_headers):
            continue
        val = info[name].decode(encoding, errors)
        try:
            val.encode('ascii')
        except UnicodeEncodeError:
            pax_headers[hname] = val
            continue
        if (len(info[name]) > length):
            pax_headers[hname] = val
    for (name, digits) in (('uid', 8), ('gid', 8), ('size', 12), ('mtime', 12)):
        if (name in pax_headers):
            info[name] = 0
            continue
        val = info[name]
        if ((not (0 <= val < (8 ** (digits - 1)))) or isinstance(val, float)):
            pax_headers[name] = unicode(val)
            info[name] = 0
    if pax_headers:
        buf = self._create_pax_generic_header(pax_headers)
    else:
        buf = ''
    return (buf + self._create_header(info, USTAR_FORMAT))
