Functions that call _get_record expect a dict as return value, if None is returned an exception is raised.
The fix is just replacing "return None" by "return {}" in _init._get_record:321.
Stack trace of the error:
File "/pygeoip/init.py", line 430, in country_code_by_addr
return self.region_by_addr(addr)['country_code']
File "/pygeoip/init.py", line 588, in region_by_addr
return self._get_region(ipnum)
File "/pygeoip/init.py", line 296, in _get_region
country_code = rec['country_code'] if 'country_code' in rec else ''
TypeError: argument of type 'NoneType' is not iterable
Functions that call _get_record expect a dict as return value, if None is returned an exception is raised. The fix is just replacing "return None" by "return {}" in _init._get_record:321.
Stack trace of the error:
File "/pygeoip/init.py", line 430, in country_code_by_addr return self.region_by_addr(addr)['country_code']
File "/pygeoip/init.py", line 588, in region_by_addr return self._get_region(ipnum)
File "/pygeoip/init.py", line 296, in _get_region country_code = rec['country_code'] if 'country_code' in rec else ''
TypeError: argument of type 'NoneType' is not iterable