ietfparse/algorithms.py
def _create_url_identifier(user, password):
    """
    Generate the user+password portion of a URL.

    :param str user: the user name or :data:`None`
    :param str password: the password or :data:`None`

    """
    if user is not None:
        user = parse.quote(user.encode('utf-8'), safe=USERINFO_SAFE_CHARS)
        if password:
            password = parse.quote(password.encode('utf-8'),
                                   safe=USERINFO_SAFE_CHARS)
            return '{0}:{1}'.format(user, password)
        return user
    return None
def _create_url_identifier(user, password):
    """
    Generate the user+password portion of a URL.

    :param str user: the user name or :data:`None`
    :param str password: the password or :data:`None`

    """
    if user is not None:
        user = parse.quote(user.encode('utf-8'), safe=USERINFO_SAFE_CHARS)
        if password:
            password = parse.quote(password.encode('utf-8'),
                                   safe=USERINFO_SAFE_CHARS)
            return '{0}:{1}'.format(user, password)
        return user
    return None
Generate the user+password portion of a URL.

    :param str user: the user name or :data:`None`
    :param str password: the password or :data:`None`