If there's no qualifier and there is an OSError or KeyError, this error message will barf because "scopename" is not set.  Do the if blocks above need to be restructured as something like:

    scopename = "group"
    if qualifier:
        aclentry.qualifier = self._norm_gid(qualifier)
    else:
        aclentry.tag_type = posix1e.ACL_GROUP_OBJ