def strip_ip_port(ip_address):
    """
    Strips the port from an IPv4 or IPv6 address, returns a unicode object.
    """
    if '.' in ip_address:
        cleaned_ip = ip_address.split(':')[0]
    elif ']:' in ip_address:
        cleaned_ip = ip_address.rpartition(':')[0][1:-1]
    else:
        cleaned_ip = ip_address
    return cleaned_ip
