﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17059	GeoIP returns no results for unicode input	David Evans	nobody	"If you provide an IP address or hostname as a unicode string you will get no results, although the equivalent query with an str works fine.

{{{
>>> from django.contrib.gis import geoip
>>> g = geoip.GeoIP(path='/usr/share/GeoIP')
>>> g.country('google.com')
{'country_name': 'United States', 'country_code': 'US'}
>>> g.country(u'google.com')
{'country_name': None, 'country_code': None}
>>> g.country('8.8.8.8')
{'country_name': 'United States', 'country_code': 'US'}
>>> g.country(u'8.8.8.8')
{'country_name': None, 'country_code': None}
}}}

Given that Django supplies unicode strings everywhere (including in request.META!['REMOTE_ADDR']) this may cause confusion and heartache.

Currently, the GeoiP._check_query() method checks that the input is an instance of basestring. This could be changed to require an instance of str or, preferably in my view, it could cast the input to an str (given that they're are only going to be IPs and hostnames anyway)."	Bug	closed	GIS	dev	Normal	fixed		d@…	Accepted	0	0	0	0	0	0
