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
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)
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)
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)