osm-fr/osmose-backend — pull request #22 by naoliv (2014-10-09 00:22:36+00:00)
Title: Fix unicode exception

urllib.quote needs to have "title" encoded as utf-8 to properly deal with URLs having non-ascii chars.

Example:

>>> urllib.quote(u'á')
/usr/lib/python2.7/urllib.py:1288: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
return ''.join(map(quoter, s))
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/urllib.py", line 1288, in quote
return ''.join(map(quoter, s))
KeyError: u'\xe1'

With encode:

>>> urllib.quote(u'á'.encode('utf-8'))
'%C3%A1'