Open jabir-khan opened 2 years ago
That is because the ok
property on the return value tells you (as the docs say) if there is any result, but the IpInfo provider is coded to treat any response from the service as a “result”. It does look like the _adapt_results
hook of IpinfoQuery
incorrectly processes the response, but it is probably not going to be fixed anytime soon. Our only option is to check both values:
info = geocoder.ip( ... )
if info.ok and info.current_result.ok:
# This means the server could be contacted AND info about the IP could be fetched.
Gotcha! great thanks.
hey I was just doing stuff with geocoder and I reeally loved it. However I guess there is some issue in it here is the details:
As you can see ip.ok is giving True but ip.json.["ok"] is returning False which doesnot satisfy this statement "If geocoder was able to contact the server, but no result could be found for the given search terms, the ok attribute on the returned object will be False." from the docs.