Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: illegal IP address string passed to inet_pton #8

Closed
david30907d opened this issue Jul 19, 2019 · 1 comment
Closed

OSError: illegal IP address string passed to inet_pton #8

david30907d opened this issue Jul 19, 2019 · 1 comment

Comments

@david30907d
Copy link

david30907d commented Jul 19, 2019

Excuse me~ I've a weird situation
In k8s, it raise this exception

>>> import IP2Location
>>> IP2LOCOBJ = IP2Location.IP2Location()
>>> IP2LOCOBJ.open("IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE.BIN")
>>> IP2LOCOBJ.get_all('2002:1a1:8fbf:0:79d0:7fec:e2be:2bcc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/airflow/src/8-0-0/IP2Location.py", line 219, in get_all
    return self._get_record(addr)
  File "/usr/local/airflow/src/8-0-0/IP2Location.py", line 385, in _get_record
    ipno = struct.unpack('!L', socket.inet_pton(socket.AF_INET, ip))[0]
OSError: illegal IP address string passed to inet_pton
>>> IP2LOCOBJ.get_all('2002:1a1:8fbf:0:79d0:7fec:e2be:2bcc')

But when i run the same code in my mac

It was just fine

>>> IP2LOCOBJ.get_all('2002:24e6:e916:0:18c0:7265:aa7b:386c')
{'ip': '60258737847196048878978323620', 'country_short': b'-', 'country_long': b'-', 'region': b'-', 'city': b'-', 'latitude': 0.0, 'longitude': 0.0}

Do you have any idea?

@ip2location
Copy link
Collaborator

Hi David,

Would you mind to provide the detail of your Python and OS version so that we can investigate further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants