-
Notifications
You must be signed in to change notification settings - Fork 111
Empty dictionary from one specific ip address #36
Comments
Hi Phillip, That address works fine in my GeoLiteCity database, where did you get yours? Any chance I can get your database to try to see if it's an underlying problem in pygeoip? An empty dictionary can be returned when the IP address can not be found in the database, or the lookup method fail for some reason. |
Hi William, I downloaded the file from here: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz Here you can find mine: http://bailey.st/files/GeoLiteCity.dat I've downloaded a new db file and just to be sure I've made a md5sum of the files, it looks fine. md5sum GeoLiteCity.dat.* Now I'm puzzled. Phillip |
This is the version of pygeoip I'm using. pip search pygeoip |
The database does not contain information for the IP. I did a sanity check with the Ruby library:
I will altough make a change to return |
I don't know why someone else didn't come across to this problem before, looks weird maxmind is missing one ip from the database. |
I think Maxmind are excluding addresses with status |
This ip belong to a botnet command control server. |
Hardcore, but I don't think this is an pygeoip issue though, Maxmind might help you further. Thanks for reporting. |
Anyway thanks for your effort and time. |
Hi William, Sorry to comment on a closed issue. Are you going to make the change to return None instead of {} ? |
Yes, record_by_addr will in >= 0.2.7 return |
This fix will really help if you iterate through an ip addresses txt file, as I'm doing. Thanks very much, |
Hi William,
Thanks for your module, it work great except with one specific ip address. Using this ip address I'm constantly getting an empty dictionary. Any clue on this?
Best,
Phillip
import pygeoip
gic = pygeoip.GeoIP('GeoLiteCity.dat')
test = gic.record_by_addr('91.201.64.20')
print test
{}
The text was updated successfully, but these errors were encountered: