def uni(key):
    '''as a crutch, we allow str-type keys, but they really should be
    unicode.

    '''
    if isinstance(key, str):
        logger.warn('assuming utf8 on: %r', key)
        return unicode(key, 'utf-8')
    elif isinstance(key, unicode):
        return key
    else:
        raise NonUnicodeKeyError(key)
as a crutch, we allow str-type keys, but they really should be
    unicode.