Exemple #1
0
def inet_ntop(space, address):
    """ Converts a packed internet address
    to a human readable representation"""
    try:
        n = rsocket.inet_ntop(rsocket.AF_INET, address)
        return space.newstr(n)
    except rsocket.RSocketError:
        return space.w_False
Exemple #2
0
def inet_ntop(space, address):
    """ Converts a packed internet address
    to a human readable representation"""
    try:
        n = rsocket.inet_ntop(rsocket.AF_INET, address)
        return space.newstr(n)
    except rsocket.RSocketError:
        return space.w_False
Exemple #3
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError, e:
        raise converted_error(space, e)
Exemple #4
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError, e:
        raise converted_error(space, e)
Exemple #5
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError as e:
        raise converted_error(space, e)
    except ValueError:
        raise oefmt(space.w_ValueError,
                    "invalid length of packed IP address string")
    return space.newtext(ip)
Exemple #6
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError as e:
        raise converted_error(space, e)
    except ValueError:
        raise oefmt(space.w_ValueError,
                    "invalid length of packed IP address string")
    return space.wrap(ip)