Closed JohnnyZ closed 7 years ago
Are you using the latest version of maxminddb
and the latest GeoLite2 City database? Would you provide the output of md5sum GeoLite2-City.mmdb
? Thanks!
Also, can you make sure you have the latest version of ipaddress
? The incorrect value appears to be coming from it.
Just upgraded my from x.x.16 to ipaddress==1.0.17 and current version of maxminddb==1.2.2.
Same error exists
And the md5sum 5f9f088f7dcf8b4ba3895b6b68930590 GeoLite2-City.mmdb . I downloaded it fresh from the site today. Let me know if it is outdated.
Thank you for your help!
What does the following output?
import ipaddress
print type(ipaddress.ip_address(u'128.101.101.101').packed)
print type(ipaddress.ip_address(u'128.101.101.101').packed) <type 'bytearray'>
Thanks. That significantly narrows down the issue. The type of the returned value is str
for me on 2.7.13 running on Ubuntu.
Would it be possible for you to test the branch greg/packed-bytearray-fix for maxminddb
? I think this should work with both return types.
That worked! Thank you for your help
@johnnyz What output do you get for
import ipaddress
print(ipaddress.__file__)
You may have installed py2-ipaddress by accident. That package claims the name ipaddress
name as well, despite having an incompatible API to the Python 3 (and thus, my backport). Their rationale is that they never want to update to Python 3, so they don't care about compability. I have adapted an email of mine about why py2-ipaddress is dangerous.
Here you go
print(ipaddress.file) /Users/username/.pyenv/versions/venv27/lib/python2.7/site-packages/backport_ipaddress-0.1-py2.7.egg/ipaddress.py
Yup, that's backport_ipaddress
, a fork of py2-ipaddress which shares the same concerns (and some more - the latest update was 2014!). Uninstall the package backport_ipaddress
and everything should work.
Thank you for your help and informing me of the concerning package.
Hey, not sure exactly what is happening here. Thank you in advance.
MAC 10.12.2