On Mon, 2009-02-23 at 16:10 -0800, arbi wrote: > Here is the Traceback, need something else? > > > Traceback: > File "/Library/Python/2.5/site-packages/django/core/handlers/base.py" > in get_response > 86. response = callback(request, *callback_args, > **callback_kwargs) > File "/Users/brouard/antrive_docs/antrive/../antrive/routes/views.py" > in route_result > 122. departure_char_list = list(gmaps_geocoder.geocode(departure, > exactly_one=False)) > File "/Library/Python/2.5/site-packages/geopy-0.93dev_r75-py2.5.egg/ > geopy/geocoders_old.py" in geocode
So this tells us that the problem isn't coming from Django, but from a third-party package. That's why the traceback is useful. It points out that the problem is not in Django. > 327. url = self.url % urlencode(params) > File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ > python2.5/urllib.py" in urlencode > 1250. v = quote_plus(str(v)) Python's urllib.urlencode method is broken when it comes to non-ASCII data. That's why Django has to ship with its own version for our usage. In this case, since you cannot control the third-party package, you will have to manually encode the data to be UTF-8 before passing it in. I'm guessing it's the departure string that is unicode in the call to gmaps_geocoder.geocode(). So encode that using departure.encode('utf-8') (if it's not "departure" that is the problem string, the same advice applies to whatever is the problem). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---