Closed john-a-m closed 7 years ago
Thank you @john-a-m, I merged this. Is there no equivalent for inet_ntop on Windows?
@hadiasghari this repo may be of interest. https://github.com/hickeroar/win_inet_pton/. It's a port of inet_ntop
and inet_pton
in native python using ctypes. That repo has a very liberal license, so I don't think it would be a problem to do something like.
try:
from socket import inet_ntop
except ImportError:
def inet_ntop(address_family, packed_ip):
#etc
I see, that could indeed be a nice way forward -- if more people are interested in this particular functionality on Windows.
-added explicit exception to OrderedDict import -wrapped inet_ntop import in try/except
running the command
python .\pyasn_util_convert.py --single rib.20161208.2200.bz2 asn_db
wouldn't work on Windows. However it does work w/ the change I am proposing. You still won't be able to use theMrtTableDump2
class on Windows, which as far as I can tell is the only thing that usesinet_ntop
.