'Return the TarInfo\'s attributes as a dictionary.'

def get_info(self, encoding, errors):

    info = {'name': self.name, 'mode': (self.mode & 4095), 'uid': self.uid, 'gid': self.gid, 'size': self.size, 'mtime': self.mtime, 'chksum': self.chksum, 'type': self.type, 'linkname': self.linkname, 'uname': self.uname, 'gname': self.gname, 'devmajor': self.devmajor, 'devminor': self.devminor}
    if ((info['type'] == DIRTYPE) and (not info['name'].endswith('/'))):
        info['name'] += '/'
    for key in ('name', 'linkname', 'uname', 'gname'):
        if (type(info[key]) is unicode):
            info[key] = info[key].encode(encoding, errors)
    return info
